From: Stephen Hemminger Date: Mon, 22 Oct 2007 20:39:09 +0000 (-0700) Subject: sky2: crash on remove X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b877fe288a325b9711d83628eb54e1deb63f962e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sky2: crash on remove Fix off-by one in remove logic that just got introduced. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- 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);