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

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
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment