aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2006-06-26 00:27:31 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 09:58:36 -0700
commit814d68629b40e863997fa0eea459be4cc99a06cc (patch)
tree85dddcb7d8c1885a2af45aa4be36b0b78a4c7ddd
parentce503f59ae899c3e75a8a1cf46f2d44c0c5b5c7c (diff)
[PATCH] dm table split_args: handle no input
Return sense if dm_split_args is called with a NULL input parameter. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/md/dm-table.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index b6183eda810..10c9439635c 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -590,6 +590,12 @@ int dm_split_args(int *argc, char ***argvp, char *input)
unsigned array_size = 0;
*argc = 0;
+
+ if (!input) {
+ *argvp = NULL;
+ return 0;
+ }
+
argv = realloc_argv(&array_size, argv);
if (!argv)
return -ENOMEM;