[PATCH] IP22: don't let kernel oops when eaddr is unset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
ArcGetenvironment returns NULL if "eaddr" is unset which lets the
following str2eaddr die.
 -- Guido
Index: drivers/net/sgiseeq.c
===================================================================
RCS file: /home/cvs/linux/drivers/net/sgiseeq.c,v
retrieving revision 1.31
diff -u -u -r1.31 sgiseeq.c
--- drivers/net/sgiseeq.c	6 Nov 2001 07:56:00 -0000	1.31
+++ drivers/net/sgiseeq.c	27 Feb 2003 18:04:25 -0000
@@ -718,6 +718,10 @@
 	 * On MIPS64 it crashes for some other, yet unknown reason ...
 	 */
 	ep = ArcGetEnvironmentVariable("eaddr");
+	if (ep == NULL) {
+		printk(KERN_INFO "Seeq8003: Can't get MAC address!\n");
+		return -ENODEV;
+	}
 	str2eaddr(onboard_eth_addr, ep);
 	return sgiseeq_init(dev,
 			    (struct sgiseeq_regs *) (KSEG1ADDR(0x1fbd4000)),

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux