qlcnic: protect qlicnic_attach_func with rtnl_lock
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Mon, 18 Apr 2016 19:19:46 +0000 (21:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Apr 2016 19:35:44 +0000 (15:35 -0400)
qlcnic_attach_func requires rtnl_lock to be held.

Cc: Dept-GELinuxNICDev@qlogic.com
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c

index 1205f6f9c941735a9f7bafb88e36705e4a5de7f2..1c29105b6c364f0064da46f0e060e11208b2526e 100644 (file)
@@ -3952,8 +3952,14 @@ static pci_ers_result_t qlcnic_82xx_io_error_detected(struct pci_dev *pdev,
 
 static pci_ers_result_t qlcnic_82xx_io_slot_reset(struct pci_dev *pdev)
 {
-       return qlcnic_attach_func(pdev) ? PCI_ERS_RESULT_DISCONNECT :
-                               PCI_ERS_RESULT_RECOVERED;
+       pci_ers_result_t res;
+
+       rtnl_lock();
+       res = qlcnic_attach_func(pdev) ? PCI_ERS_RESULT_DISCONNECT :
+                                        PCI_ERS_RESULT_RECOVERED;
+       rtnl_unlock();
+
+       return res;
 }
 
 static void qlcnic_82xx_io_resume(struct pci_dev *pdev)