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>
This commit is contained in:
Shinya Kuribayashi 2007-12-27 15:39:54 +09:00 committed by Wolfgang Denk
parent 3b93020d74
commit b9173af73e

View file

@ -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