From: YueHaibing Date: Wed, 25 Jul 2018 10:00:49 +0000 (+0800) Subject: tipc: add missing dev_put() on error in tipc_enable_l2_media X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=63135ee0a6e5f5a5ad1345e48099e62d3d617a81;p=linux.git tipc: add missing dev_put() on error in tipc_enable_l2_media when tipc_own_id failed to obtain node identity,dev_put should be call before return -EINVAL. Fixes: 682cd3cf946b ("tipc: confgiure and apply UDP bearer MTU on running links") Signed-off-by: YueHaibing Signed-off-by: David S. Miller --- diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index fd6d8f18955ca..418f03d0be90f 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c @@ -395,6 +395,7 @@ int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b, tipc_net_init(net, node_id, 0); } if (!tipc_own_id(net)) { + dev_put(dev); pr_warn("Failed to obtain node identity\n"); return -EINVAL; }