From: Michael Hennerich <michael.hennerich@xxxxxxxxxx> In case optarg n is not given return/exit Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html