summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_demo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/cmd_demo.c b/common/cmd_demo.c
index bcb34d9045..8a10bdf42a 100644
--- a/common/cmd_demo.c
+++ b/common/cmd_demo.c
@@ -97,7 +97,9 @@ static int do_demo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ARRAY_SIZE(demo_commands));
argc -= 2;
argv += 2;
- if (!demo_cmd || argc > demo_cmd->maxargs)
+
+ if ((!demo_cmd || argc > demo_cmd->maxargs) ||
+ ((demo_cmd->name[0] != 'l') && (argc < 1)))
return CMD_RET_USAGE;
if (argc) {
OpenPOWER on IntegriCloud