Skip to contentSkip to conversation

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

PATCH New Guido Guenther 1 participant 1 message Feb 27, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IP22: don't let kernel oops when eaddr is unset

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

net/sgiseeq.c +4 -0
diff -u -u -r1.31 sgiseeq.c
@@ -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)),