summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2018-12-23 21:45:56 -0800
committerDavid S. Miller <davem@davemloft.net>2018-12-27 16:16:17 -0800
commitdc4501ff287547dea7ca10f1c580c741291a8760 (patch)
tree0a10986ad2cdbfbe097751d9d6183185b5e8f86f /net
parentb71acb0e372160167bf6d5500b88b30b52ccef6e (diff)
downloadlinux-dc4501ff287547dea7ca10f1c580c741291a8760.tar.gz
linux-dc4501ff287547dea7ca10f1c580c741291a8760.tar.bz2
linux-dc4501ff287547dea7ca10f1c580c741291a8760.zip
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: syzbot+b981acf1fb240c0c128b@syzkaller.appspotmail.com Cc: Ying Xue <ying.xue@windriver.com> Cc: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/bearer.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index fb2c0d8f359f..d27f30a9a01d 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -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;
}