summaryrefslogtreecommitdiff
path: root/net/tipc/bearer.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-07-25 13:00:49 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-27 00:05:11 +0300
commit63135ee0a6e5f5a5ad1345e48099e62d3d617a81 (patch)
treeb98bb664f42379e567073e0fa530cbd4b1638c0f /net/tipc/bearer.c
parent201876b33c09edcb6c2914f0ced798437a102648 (diff)
downloadlinux-63135ee0a6e5f5a5ad1345e48099e62d3d617a81.tar.xz
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 <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r--net/tipc/bearer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index fd6d8f18955c..418f03d0be90 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;
}