Skip to contentSkip to conversation

net/smc: fix ethernet interface refcounting

PATCH In review Karsten Graul 2 participants 2 messages Nov 6, 2019 – Nov 7, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/smc: fix ethernet interface refcounting

From: Ursula Braun <[email protected]>

If a pnet table entry is to be added mentioning a valid ethernet interface, but an invalid infiniband or ISM device, the dev_put() operation for the ethernet interface is called twice, resulting in a negative refcount for the ethernet interface, which disables removal of such a network interface.

This patch removes one of the dev_put() calls.

Fixes 890a2cb4a966 ("net/smc: rework pnet table")
---
 net/smc/smc_pnet.c | 2 --
 1 file changed, 2 deletions(-)
net/smc/smc_pnet.c +0 -2
index 2920b006f65c..571e6d84da3b 100644
@@ -376,8 +376,6 @@ static int smc_pnet_fill_entry(struct net *net,
 	return 0;
 
 error:
-	if (pnetelem->ndev)
-		dev_put(pnetelem->ndev);
 	return rc;
 }
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw

From: Karsten Graul <[email protected]>
Date: Wed, 6 Nov 2019 10:49:57 +0100

Quoted 8 lines

From: Ursula Braun <[email protected]>

If a pnet table entry is to be added mentioning a valid ethernet interface, but an invalid infiniband or ISM device, the dev_put() operation for the ethernet interface is called twice, resulting in a negative refcount for the ethernet interface, which disables removal of such a network interface.

Quoted 5 lines

This patch removes one of the dev_put() calls.

Fixes 890a2cb4a966 ("net/smc: rework pnet table")

Applied and queued up for -stable, thanks.