Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 065896e9 authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman
Browse files

IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference



In case optarg n is not given return/exit

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7c31b984
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,9 @@ int main(int argc, char **argv)
		}
	}

	if (device_name == NULL)
		return -1;

	/* Find the device requested */
	dev_num = find_type_by_name(device_name, "device");
	if (dev_num < 0) {