igb: Fix a deadlock in igb_sriov_reinit
authorJia-Ju Bai <baijiaju1990@163.com>
Mon, 3 Aug 2015 03:36:26 +0000 (11:36 +0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 18 Aug 2015 21:06:05 +0000 (14:06 -0700)
When igb_init_interrupt_scheme in igb_sriov_reinit is failed, the lock
acquired by rtnl_lock() is not released, which causes a deadlock.
This patch adds rtnl_unlock() in error handling to fix it.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c

index 8d22298236ad1e250f26925df3d29a7044529dfb..17c1c842c33d93e0a362b029068753855065718b 100644 (file)
@@ -7413,6 +7413,7 @@ static int igb_resume(struct device *dev)
 
        if (igb_init_interrupt_scheme(adapter, true)) {
                dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+               rtnl_unlock();
                return -ENOMEM;
        }