All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] common/cmd_mii.c: Add sanity argc check
@ 2007-12-27  6:39 Shinya Kuribayashi
  2007-12-27  6:56 ` Shinya Kuribayashi
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Shinya Kuribayashi @ 2007-12-27  6:39 UTC (permalink / raw)
  To: u-boot

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

 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 b771322..b99bd06 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-09 20:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-27  6:39 [U-Boot-Users] [PATCH] common/cmd_mii.c: Add sanity argc check Shinya Kuribayashi
2007-12-27  6:56 ` Shinya Kuribayashi
2007-12-27 13:43   ` gvb.uboot
2007-12-27 15:14 ` Andrew Dyer
2007-12-28  1:17   ` Shinya Kuribayashi
2007-12-28  3:43 ` [U-Boot-Users] [PATCH 1/2] cmd_mii.c: Fix a NULL pointer dereference Shinya Kuribayashi
2008-01-09 20:36 ` [U-Boot-Users] [PATCH] common/cmd_mii.c: Add sanity argc check Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.