tipc: fix a double free in tipc_enable_bearer()
Subsystems (3)
PATCH 1/1 tipc: fix a double free in tipc_enable_bearer()
bearer_disable() already calls kfree_rcu() to free struct tipc_bearer, we don't need to call kfree() again.
Fixes cb30a63384bc ("tipc: refactor function tipc_enable_bearer()")
Reported-by [email protected]
Cc Ying Xue <[email protected]>
Cc Jon Maloy <[email protected]>
Signed-off-by Cong Wang <[email protected]>
--- net/tipc/bearer.c | 1 - 1 file changed, 1 deletion(-)
net/tipc/bearer.c +0 -1
@@ -319,7 +319,6 @@ static int tipc_enable_bearer(struct net *net, const char *name, res =tipc_disc_create (net, b, &b->bcast_addr, &skb);if (res) {bearer_disable (net, b); -kfree (b); errstr ="failed to create discoverer" ; goto rejected; }
Signature · 1 line
2.19.2
David Miller
maintainerFrom: Cong Wang <[email protected]>
Date: Sun, 23 Dec 2018 21:45:56 -0800
Quoted 8 lines
bearer_disable()already callskfree_rcu()to free structtipc_bearer, we don't need to callkfree()again.Fixes cb30a63384bc ("tipc: refactor function tipc_enable_bearer()")Reported-by [email protected]Cc Ying Xue <[email protected]>Cc Jon Maloy <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied and queued up for -stable, thanks Cong.