summaryrefslogtreecommitdiff
path: root/libdm
diff options
context:
space:
mode:
Diffstat (limited to 'libdm')
-rw-r--r--libdm/dm-tools/dmsetup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c
index f431f7509..f6d1ecf90 100644
--- a/libdm/dm-tools/dmsetup.c
+++ b/libdm/dm-tools/dmsetup.c
@@ -6426,9 +6426,10 @@ static const struct command *_find_command(const struct command *commands,
{
int i;
- for (i = 0; commands[i].name; i++)
- if (!strcmp(commands[i].name, name))
- return commands + i;
+ if (name)
+ for (i = 0; commands[i].name; i++)
+ if (!strcmp(commands[i].name, name))
+ return commands + i;
return NULL;
}