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 <shinya.kuribayashi@necel.com>
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index f530a38..079612a 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -438,6 +438,11 @@
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