summaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-10-22 13:39:09 -0700
committerJeff Garzik <jeff@garzik.org>2007-10-23 20:18:13 -0400
commitb877fe288a325b9711d83628eb54e1deb63f962e (patch)
tree18396c733e8f4eb684597e9fafbf3b885801603d /drivers/net/sky2.c
parentf5e42fbab6c6ca39a33410a0ed0037589908c264 (diff)
downloadlinux-b877fe288a325b9711d83628eb54e1deb63f962e.tar.gz
linux-b877fe288a325b9711d83628eb54e1deb63f962e.tar.bz2
linux-b877fe288a325b9711d83628eb54e1deb63f962e.zip
sky2: crash on remove
Fix off-by one in remove logic that just got introduced. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r--drivers/net/sky2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 24cfb6275d9b..c27c7d63b6a5 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4271,7 +4271,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
del_timer_sync(&hw->watchdog_timer);
cancel_work_sync(&hw->restart_work);
- for (i = hw->ports; i >= 0; --i)
+ for (i = hw->ports-1; i >= 0; --i)
unregister_netdev(hw->dev[i]);
sky2_write32(hw, B0_IMSK, 0);
@@ -4289,7 +4289,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
pci_release_regions(pdev);
pci_disable_device(pdev);
- for (i = hw->ports; i >= 0; --i)
+ for (i = hw->ports-1; i >= 0; --i)
free_netdev(hw->dev[i]);
iounmap(hw->regs);