mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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:
parent
3b93020d74
commit
b9173af73e
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue