[PATCH] skge: dont allow bad hardware address from ROM
authorStephen Hemminger <shemminger@osdl.org>
Tue, 6 Jun 2006 17:11:14 +0000 (10:11 -0700)
committerJeff Garzik <jeff@garzik.org>
Thu, 8 Jun 2006 19:44:54 +0000 (15:44 -0400)
Sometimes boards don't reset properly, and the address read out of the
EEPROM is zero. Stop the insanity before the device gets registered.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/skge.c

index f377c259a39846b5e7646be90f6b22b152c4567d..5044f45023a43151ac88ce8c8a950bcfaf415c79 100644 (file)
@@ -3362,6 +3362,14 @@ static int __devinit skge_probe(struct pci_dev *pdev,
        if ((dev = skge_devinit(hw, 0, using_dac)) == NULL)
                goto err_out_led_off;
 
+       if (!is_valid_ether_addr(dev->dev_addr)) {
+               printk(KERN_ERR PFX "%s: bad (zero?) ethernet address in rom\n",
+                      pci_name(pdev));
+               err = -EIO;
+               goto err_out_free_netdev;
+       }
+
+
        err = register_netdev(dev);
        if (err) {
                printk(KERN_ERR PFX "%s: cannot register net device\n",