From: Devendra Naga Date: Thu, 31 May 2012 01:51:20 +0000 (+0000) Subject: r8169: call netif_napi_del at errpaths and at driver unload X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad1be8d345416a794dea39761a374032aa471a76;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git r8169: call netif_napi_del at errpaths and at driver unload when register_netdev fails, the init'ed NAPIs by netif_napi_add must be deleted with netif_napi_del, and also when driver unloads, it should delete the NAPI before unregistering netdevice using unregister_netdev. Signed-off-by: Devendra Naga Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 00b4f56a671c..9757ce3543a0 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -6345,6 +6345,8 @@ static void __devexit rtl_remove_one(struct pci_dev *pdev) cancel_work_sync(&tp->wk.work); + netif_napi_del(&tp->napi); + unregister_netdev(dev); rtl_release_firmware(tp); @@ -6668,6 +6670,7 @@ out: return rc; err_out_msi_4: + netif_napi_del(&tp->napi); rtl_disable_msi(pdev, tp); iounmap(ioaddr); err_out_free_res_3: