Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c76f2481 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

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: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a91ded3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;