summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.ibm.com>2019-11-06 10:49:57 +0100
committerDavid S. Miller <davem@davemloft.net>2019-11-06 17:44:32 -0800
commit98f3375505b8d6517bd6710bc6d4f6289eeb30aa (patch)
tree2f631ea75800af5538977e20b3d0f944d865561f
parent9990a79d8fe21ba9598e8d98383552a9fea632da (diff)
downloadlinux-98f3375505b8d6517bd6710bc6d4f6289eeb30aa.tar.bz2
net/smc: fix ethernet interface refcounting
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") Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/smc/smc_pnet.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
index 2920b006f65c..571e6d84da3b 100644
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -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;
}