提交 86ae1c8b 编写于 作者: C Cong Wang 提交者: Xie XiuQi

tipc: fix a double free in tipc_enable_bearer()

[ Upstream commit dc4501ff ]

bearer_disable() already calls kfree_rcu() to free struct tipc_bearer,
we don't need to call kfree() again.

Fixes: cb30a633 ("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: NCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 10795b0f
...@@ -317,7 +317,6 @@ static int tipc_enable_bearer(struct net *net, const char *name, ...@@ -317,7 +317,6 @@ static int tipc_enable_bearer(struct net *net, const char *name,
res = tipc_disc_create(net, b, &b->bcast_addr, &skb); res = tipc_disc_create(net, b, &b->bcast_addr, &skb);
if (res) { if (res) {
bearer_disable(net, b); bearer_disable(net, b);
kfree(b);
errstr = "failed to create discoverer"; errstr = "failed to create discoverer";
goto rejected; goto rejected;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册