]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
tipc: add missing dev_put() on error in tipc_enable_l2_media
authorYueHaibing <yuehaibing@huawei.com>
Wed, 25 Jul 2018 10:00:49 +0000 (18:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Jul 2018 21:05:11 +0000 (14:05 -0700)
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>
net/tipc/bearer.c

index fd6d8f18955ca21941360790f9ef42fef42d70a1..418f03d0be90f076cf34b1ee96495ceb3a3d68de 100644 (file)
@@ -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;
        }