diff options
author | Shinya Kuribayashi <shinya.kuribayashi@necel.com> | 2007-12-27 15:39:54 +0900 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-01-09 21:36:29 +0100 |
commit | b9173af73e524d37c812f210173cf83385c5171a (patch) | |
tree | 6ddb455d29111ffe66833a12bdbaa1038c737559 /common | |
parent | 3b93020d74630f0574cbd26d200a82c00dd11eaa (diff) | |
download | u-boot-b9173af73e524d37c812f210173cf83385c5171a.tar.gz |
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_mii.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 |