r8169: call netif_napi_del at errpaths and at driver unload
PATCH 1/1 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.
--- drivers/net/ethernet/realtek/r8169.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/realtek/r8169.c +3 -0
@@ -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:
Signature · 1 line
1.7.9.5
David Miller
maintainerFrom: Devendra Naga <[email protected]>
Date: Thu, 31 May 2012 17:21:20 +0530
Quoted 5 lines
when
register_netdevfails, the init'ed NAPIs bynetif_napi_addmust be deleted withnetif_napi_del, and also when driver unloads, it should delete the NAPI before unregistering netdevice usingunregister_netdev.Signed-off-by Devendra Naga <[email protected]>
Francois, I'm assuming you will merge this to me after you've done some testing.
David Miller <[email protected]> :
[...]
Quoted 2 lines
Francois, I'm assuming you will merge this to me after you've done some testing.
You can apply it directly.
I have done several loops both with a forced error patch and the normal removal of the module without problem. No trivial crash. Four 816x network adapters. Reference one still comes up.
Signature · 1 line
Ueimor
David Miller
maintainerFrom: Francois Romieu <[email protected]>
Date: Fri, 1 Jun 2012 21:29:44 +0200
Quoted 10 lines
David Miller <[email protected]> :
[...]Quoted 2 lines
Francois, I'm assuming you will merge this to me after you've done some testing.
You can apply it directly.
I have done several loops both with a forced error patch and the normal removal of the module without problem. No trivial crash. Four 816x network adapters. Reference one still comes up.
Ok, applied, thanks.