summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cmd_onenand.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index fe84c3be96..5550b40b81 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -535,6 +535,9 @@ static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]
{
cmd_tbl_t *c;
+ if (argc < 2)
+ return cmd_usage(cmdtp);
+
mtd = &onenand_mtd;
/* Strip off leading 'onenand' command argument */