tipc: fix a double free in tipc_enable_bearer()
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 24 Dec 2018 05:45:56 +0000 (21:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:38:34 +0000 (17:38 +0100)
commitf404723deb695a00ea2cb7800b2c2135260dfcf8
tree870d5d76ab4a915e740b2b1ef474f8b299a0f319
parenta2ee6fb9c675125f2f29cc95aae95b4489880f57
tipc: fix a double free in tipc_enable_bearer()

[ Upstream commit dc4501ff287547dea7ca10f1c580c741291a8760 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/bearer.c