diff options
-rw-r--r-- | drivers/net/sky2.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index fc3803316970..4bb52e9cd371 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -4550,16 +4550,18 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
4550 | if (hw->ports > 1) { | 4550 | if (hw->ports > 1) { |
4551 | struct net_device *dev1; | 4551 | struct net_device *dev1; |
4552 | 4552 | ||
4553 | err = -ENOMEM; | ||
4553 | dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default); | 4554 | dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default); |
4554 | if (!dev1) | 4555 | if (dev1 && (err = register_netdev(dev1)) == 0) |
4555 | dev_warn(&pdev->dev, "allocation for second device failed\n"); | 4556 | sky2_show_addr(dev1); |
4556 | else if ((err = register_netdev(dev1))) { | 4557 | else { |
4557 | dev_warn(&pdev->dev, | 4558 | dev_warn(&pdev->dev, |
4558 | "register of second port failed (%d)\n", err); | 4559 | "register of second port failed (%d)\n", err); |
4559 | hw->dev[1] = NULL; | 4560 | hw->dev[1] = NULL; |
4560 | free_netdev(dev1); | 4561 | hw->ports = 1; |
4561 | } else | 4562 | if (dev1) |
4562 | sky2_show_addr(dev1); | 4563 | free_netdev(dev1); |
4564 | } | ||
4563 | } | 4565 | } |
4564 | 4566 | ||
4565 | setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); | 4567 | setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); |