Commit b877fe28 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

sky2: crash on remove

Fix off-by one in remove logic that just got introduced.
Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f5e42fba
...@@ -4271,7 +4271,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev) ...@@ -4271,7 +4271,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
del_timer_sync(&hw->watchdog_timer); del_timer_sync(&hw->watchdog_timer);
cancel_work_sync(&hw->restart_work); 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]); unregister_netdev(hw->dev[i]);
sky2_write32(hw, B0_IMSK, 0); sky2_write32(hw, B0_IMSK, 0);
...@@ -4289,7 +4289,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev) ...@@ -4289,7 +4289,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev)
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(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]); free_netdev(hw->dev[i]);
iounmap(hw->regs); iounmap(hw->regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment