* [PATCH net] net/smc: fix ethernet interface refcounting
@ 2019-11-06 9:49 Karsten Graul
2019-11-07 1:46 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Karsten Graul @ 2019-11-06 9:49 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
From: Ursula Braun <ubraun@linux.ibm.com>
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>
---
net/smc/smc_pnet.c | 2 --
1 file changed, 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;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net/smc: fix ethernet interface refcounting
2019-11-06 9:49 [PATCH net] net/smc: fix ethernet interface refcounting Karsten Graul
@ 2019-11-07 1:46 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-07 1:46 UTC (permalink / raw)
To: kgraul; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
From: Karsten Graul <kgraul@linux.ibm.com>
Date: Wed, 6 Nov 2019 10:49:57 +0100
> From: Ursula Braun <ubraun@linux.ibm.com>
>
> 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>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-07 1:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 9:49 [PATCH net] net/smc: fix ethernet interface refcounting Karsten Graul
2019-11-07 1:46 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.