2015-08-03 03:36:53

by Jia-Ju Bai

[permalink] [raw]
Subject: [PATCH] igb: Fix a deadlock in igb_sriov_reinit

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 <[email protected]>
---
drivers/net/ethernet/intel/igb/igb_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 2f70a9b..311d1ca 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7539,6 +7539,7 @@ static int igb_sriov_reinit(struct pci_dev *dev)

if (igb_init_interrupt_scheme(adapter, true)) {
dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+ rtnl_unlock();
return -ENOMEM;
}

--
1.7.9.5


2015-08-11 02:06:58

by Brown, Aaron F

[permalink] [raw]
Subject: RE: [PATCH] igb: Fix a deadlock in igb_sriov_reinit

> From: [email protected] [mailto:[email protected]]
> On Behalf Of Jia-Ju Bai
> Sent: Sunday, August 02, 2015 8:36 PM
> To: Kirsher, Jeffrey T; Brandeburg, Jesse
> Cc: [email protected]; [email protected]; linux-
> [email protected]; Jia-Ju Bai
> Subject: [PATCH] igb: Fix a deadlock in igb_sriov_reinit
>
> 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 <[email protected]>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 1 +
> 1 file changed, 1 insertion(+)

Tested-by: Aaron Brown <[email protected]>