Check argument count in "mii" command.
authorWolfgang Denk <wd@pollux.denx.de>
Fri, 21 Jul 2006 09:20:46 +0000 (11:20 +0200)
committerWolfgang Denk <wd@pollux.denx.de>
Fri, 21 Jul 2006 09:20:46 +0000 (11:20 +0200)
Problem pointed out by Andrew Dyer, 13 Jun 2005

CHANGELOG
common/cmd_mii.c

index 41fd312..4f6da77 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Check argument count in "mii" command.
+  Problem pointed out by Andrew Dyer, 13 Jun 2005
+
 * Cleanup TQM5200 board configurations:
   - make highboot configurations use environment at high end, too,
     to avoid flash fragmentation
index 48a4e77..ee5e43e 100644 (file)
@@ -57,6 +57,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_MCF52x2)
        mii_init ();
 #endif