Title: [9685] trunk/drivers/staging/iio/Documentation/generic_buffer.c: merge from upstream: IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference
- Revision
- 9685
- Author
- vapier
- Date
- 2011-03-01 16:18:38 -0500 (Tue, 01 Mar 2011)
Log Message
merge from upstream: IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference
From: Michael Hennerich <[email protected]>
In case optarg n is not given return/exit
Signed-off-by: Michael Hennerich <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Modified Paths
Diff
Modified: trunk/drivers/staging/iio/Documentation/generic_buffer.c (9684 => 9685)
--- trunk/drivers/staging/iio/Documentation/generic_buffer.c 2011-03-01 21:18:33 UTC (rev 9684)
+++ trunk/drivers/staging/iio/Documentation/generic_buffer.c 2011-03-01 21:18:38 UTC (rev 9685)
@@ -168,6 +168,9 @@
}
}
+ if (device_name == NULL)
+ return -1;
+
/* Find the device requested */
dev_num = find_type_by_name(device_name, "device");
if (dev_num < 0) {
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits