[net] ixgbe: fix possible deadlock in ixgbe_service_task()
diff mbox series

Message ID 20190715045706.6140-1-ap420073@gmail.com
State Superseded
Delegated to: Jeff Kirsher
Headers show
Series
  • [net] ixgbe: fix possible deadlock in ixgbe_service_task()
Related show

Commit Message

Taehee Yoo July 15, 2019, 4:57 a.m. UTC
ixgbe_service_task() calls unregister_netdev() under rtnl_lock().
But unregister_netdev() internally calls rtnl_lock().
So deadlock would occur.

Fixes: 59dd45d550c5 ("ixgbe: firmware recovery mode")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
I did only compile test because I don't have the hardware.
Could anyone test this patch?
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Bowers, AndrewX July 19, 2019, 4:17 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Taehee Yoo
> Sent: Sunday, July 14, 2019 9:57 PM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; intel-wired-
> lan@lists.osuosl.org; ap420073@gmail.com
> Subject: [Intel-wired-lan] [PATCH net] ixgbe: fix possible deadlock in
> ixgbe_service_task()
> 
> ixgbe_service_task() calls unregister_netdev() under rtnl_lock().
> But unregister_netdev() internally calls rtnl_lock().
> So deadlock would occur.
> 
> Fixes: 59dd45d550c5 ("ixgbe: firmware recovery mode")
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> ---
> I did only compile test because I don't have the hardware.
> Could anyone test this patch?
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 --
>  1 file changed, 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch
diff mbox series

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 57fd9ee6de66..b4888be94dfb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7894,9 +7894,7 @@  static void ixgbe_service_task(struct work_struct *work)
 	}
 	if (ixgbe_check_fw_error(adapter)) {
 		if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
-			rtnl_lock();
 			unregister_netdev(adapter->netdev);
-			rtnl_unlock();
 		}
 		ixgbe_service_event_complete(adapter);
 		return;