From b9173af73e524d37c812f210173cf83385c5171a Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Thu, 27 Dec 2007 15:39:54 +0900 Subject: [PATCH] common/cmd_mii.c: Add sanity argc check If type mii command without arguments, we suffer from uninitialized argv[] entries; for example we MIPS get stuck by TLB error. Signed-off-by: Shinya Kuribayashi --- common/cmd_mii.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/cmd_mii.c b/common/cmd_mii.c index f530a38421..079612a4e6 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -438,6 +438,11 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) int rcode = 0; char *devname; + if (argc < 2) { + printf("Usage:\n%s\n", cmdtp->usage); + return 1; + } + #if defined(CONFIG_8xx) || defined(CONFIG_MCF532x) mii_init (); #endif -- 2.39.5