Skip to contentSkip to conversation

iavf: fix double-release of rtnl_lock

PATCH In review Jakub Kicinski 3 participants 4 messages Dec 3, 2020 – Dec 14, 2020

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 iavf: fix double-release of rtnl_lock

This code does not jump to exit on an error in iavf_lan_add_device(), so the rtnl_unlock() from the normal path will follow.

Fixes b66c7bc1cd4d ("iavf: Refactor init state machine")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -3
index 95543dfd4fe7..0a867d64d467 100644
@@ -1829,21 +1829,19 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter)
 		}
 	}
 
 	adapter->netdev_registered = true;
 
 	netif_tx_stop_all_queues(netdev);
 	if (CLIENT_ALLOWED(adapter)) {
 		err = iavf_lan_add_device(adapter);
-		if (err) {
-			rtnl_unlock();
+		if (err)
 			dev_info(&pdev->dev, "Failed to add VF to client API service list: %d\n",
 				 err);
-		}
 	}
 	dev_info(&pdev->dev, "MAC address: %pM\n", adapter->hw.mac.addr);
 	if (netdev->features & NETIF_F_GRO)
 		dev_info(&pdev->dev, "GRO is enabled\n");
 
 	adapter->state = __IAVF_DOWN;
 	set_bit(__IAVF_VSI_DOWN, adapter->vsi.state);
 	rtnl_unlock();
Signature · 1 line
2.26.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jakub Kicinski

This code does not jump to exit on an error in iavf_lan_add_device(), so the rtnl_unlock() from the normal path will follow.

Fixes b66c7bc1cd4d ("iavf: Refactor init state machine")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Did you want to apply this or did you want me to take it?

author maintainer
#2 lore raw
Quoted 10 lines · Anthony L
Quoted 8 lines · Jakub Kicinski

This code does not jump to exit on an error in iavf_lan_add_device(), so the rtnl_unlock() from the normal path will follow.

Fixes b66c7bc1cd4d ("iavf: Refactor init state machine")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)  
Quoted 3 lines

Did you want to apply this or did you want me to take it?

Please take it, I'm currently running with the assumption that you'll take all Intel patches (minus some corner cases, maybe, like patches which are part of some cross-tree series with dependencies).

Thanks!

#3 lore raw
Quoted 11 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jakub Kicinski
Sent: czwartek, 3 grudnia 2020 18:41
To: Nguyen, Anthony L <[email protected]>
Cc: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org; Pawlak, Jakub <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net] iavf: fix double-release of rtnl_lock

Quoted 15 lines
Quoted 3 lines · Anthony L
Quoted 2 lines · Jakub Kicinski

This code does not jump to exit on an error in iavf_lan_add_device(), so the rtnl_unlock() from the normal path will

follow.

Quoted 10 lines
Quoted 6 lines
Fixes b66c7bc1cd4d ("iavf: Refactor init state machine")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Did you want to apply this or did you want me to take it?

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Sowackiego 173 | 80-298 Gdask | Sd Rejonowy Gdask Pnoc | VII Wydzia Gospodarczy Krajowego Rejestru Sdowego - KRS 101882 | NIP 957-07-52-316 | Kapita zakadowy 200.000 PLN.
Ta wiadomo wraz z zacznikami jest przeznaczona dla okrelonego adresata i moe zawiera informacje poufne. W razie przypadkowego otrzymania tej wiadomoci, prosimy o powiadomienie nadawcy oraz trwae jej usunicie; jakiekolwiek przegldanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.