[PATCH 10/15] dm table split_args: handle no input

From: Alasdair G Kergon
Date: Wed Jun 21 2006 - 15:38:27 EST


From: David Teigland <teigland@xxxxxxxxxx>

Return sense if dm_split_args is called with a NULL input parameter.

Signed-off-by: David Teigland <teigland@xxxxxxxxxx>
Signed-off-by: Alasdair G Kergon <agk@xxxxxxxxxx>

Index: linux-2.6.17/drivers/md/dm-table.c
===================================================================
--- linux-2.6.17.orig/drivers/md/dm-table.c 2006-06-21 16:19:33.000000000 +0100
+++ linux-2.6.17/drivers/md/dm-table.c 2006-06-21 17:17:58.000000000 +0100
@@ -590,6 +590,12 @@ int dm_split_args(int *argc, char ***arg
unsigned array_size = 0;

*argc = 0;
+
+ if (!input) {
+ *argvp = NULL;
+ return 0;
+ }
+
argv = realloc_argv(&array_size, argv);
if (!argv)
return -ENOMEM;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/