mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 20:23:57 +08:00
IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference
In case optarg n is not given return/exit Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
7c31b984c4
commit
065896e904
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user