From: YueHaibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <jon.maloy@ericsson.com>,
<ying.xue@windriver.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<tipc-discussion@lists.sourceforge.net>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH net-next] tipc: add missing dev_put() on error in tipc_enable_l2_media
Date: Wed, 25 Jul 2018 18:00:49 +0800 [thread overview]
Message-ID: <20180725100049.20244-1-yuehaibing@huawei.com> (raw)
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>
---
net/tipc/bearer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index fd6d8f1..418f03d 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;
}
--
2.7.0
next reply other threads:[~2018-07-25 10:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 10:00 YueHaibing [this message]
2018-07-26 2:18 ` [PATCH net-next] tipc: add missing dev_put() on error in tipc_enable_l2_media Jon Maloy
2018-07-26 21:05 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180725100049.20244-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=davem@davemloft.net \
--cc=jon.maloy@ericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox