提交 c76f2481 编写于 作者: W Wei Yongjun 提交者: David S. Miller

tipc: fix error handling in tipc_udp_enable()

Release alloced resource before return from the error handling
case in tipc_udp_enable(), otherwise will cause memory leak.

Fixes: 52dfae5c ("tipc: obtain node identity from interface by default")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Acked-by: NJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6a91ded3
......@@ -687,7 +687,8 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
}
if (!tipc_own_id(net)) {
pr_warn("Failed to set node id, please configure manually\n");
return -EINVAL;
err = -EINVAL;
goto err;
}
b->bcast_addr.media_id = TIPC_MEDIA_TYPE_UDP;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册