Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference
@ 2011-02-15 14:46 michael.hennerich
  2011-02-15 14:46 ` [PATCH] IIO: Documentation: iio_utils: Avoid double free() michael.hennerich
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: michael.hennerich @ 2011-02-15 14:46 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, drivers, device-drivers-devel, Michael Hennerich

From: Michael Hennerich <michael.hennerich@analog.com>

In case optarg n is not given return/exit

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/staging/iio/Documentation/generic_buffer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/iio/Documentation/generic_buffer.c b/drivers/staging/iio/Documentation/generic_buffer.c
index df23aeb..131d9d0 100644
--- a/drivers/staging/iio/Documentation/generic_buffer.c
+++ b/drivers/staging/iio/Documentation/generic_buffer.c
@@ -151,6 +151,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) {
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-02-22 20:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 14:46 [PATCH] IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference michael.hennerich
2011-02-15 14:46 ` [PATCH] IIO: Documentation: iio_utils: Avoid double free() michael.hennerich
2011-02-22 15:09   ` Jonathan Cameron
2011-02-15 14:46 ` [PATCH] IIO: Documentation: iio_utils: Fix typo michael.hennerich
2011-02-22 19:11   ` Jonathan Cameron
2011-02-15 14:46 ` [PATCH] IIO: Documentation: generic_buffer example: scan_size must be bytes_per_datum michael.hennerich
2011-02-22 18:48   ` Jonathan Cameron
2011-02-22 20:21     ` Michael Hennerich
2011-02-22 20:45       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox