aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLekensteyn <lekensteyn@gmail.com>2013-07-22 03:53:30 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-24 18:42:59 -0400
commit4ea72445bddd2ca09fc719065fc3c5a8bfc8ca10 (patch)
tree93d3f2ac1c2284447a390cf5ffe71f13672addcb /drivers/net
parentf8c0aca9fda7856a8a8d61d523ba3187affbd714 (diff)
r8169: fix lockdep warning when removing interface
The work queue is initialised in rtl_open (when the interface goes up), but canceled in rtl_remove_one (when the PCI device gets removed). If the network interface is not brought up, then the work queue struct is not initialised. When the device is removed, the attempt to cancel the uninitialised work queue causes a lockdep warning. This patch fixes the issue by moving cancel_work_sync to rtl_close (to match rtl_open). (Note that rtl_close is also called via unregister_netdev in rtl_remove_one.) Signed-off-by: Peter Wu <lekensteyn@gmail.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/realtek/r8169.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 4106a743ca74..880015cae6a3 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6468,6 +6468,8 @@ static int rtl8169_close(struct net_device *dev)
6468 rtl8169_down(dev); 6468 rtl8169_down(dev);
6469 rtl_unlock_work(tp); 6469 rtl_unlock_work(tp);
6470 6470
6471 cancel_work_sync(&tp->wk.work);
6472
6471 free_irq(pdev->irq, dev); 6473 free_irq(pdev->irq, dev);
6472 6474
6473 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, 6475 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
@@ -6793,8 +6795,6 @@ static void rtl_remove_one(struct pci_dev *pdev)
6793 rtl8168_driver_stop(tp); 6795 rtl8168_driver_stop(tp);
6794 } 6796 }
6795 6797
6796 cancel_work_sync(&tp->wk.work);
6797
6798 netif_napi_del(&tp->napi); 6798 netif_napi_del(&tp->napi);
6799 6799
6800 unregister_netdev(dev); 6800 unregister_netdev(dev);