From: Nicholas Krause <xerofoify@gmail.com>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: [PATCH] bridge:Fix incorrect variable assignment on error path in br_sysfs_addbr
Date: Wed, 16 Mar 2016 14:31:17 -0400 [thread overview]
Message-ID: <1458153077-28586-1-git-send-email-xerofoify@gmail.com> (raw)
This fixes the incorrect variable assignment on error path in
br_sysfs_addbr for when the call to kobject_create_and_add
fails to assign the value of -EINVAL to the returned variable of
err rather then incorrectly return zero making callers think this
function has succeededed due to the previous assignment being
assigned zero when assigning it the successful return value of
the call to sysfs_create_group which is zero.
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
net/bridge/br_sysfs_br.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 6b80914..6833d25 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -872,6 +872,7 @@ int br_sysfs_addbr(struct net_device *dev)
if (!br->ifobj) {
pr_info("%s: can't add kobject (directory) %s/%s\n",
__func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR);
+ err = -EINVAL;
goto out3;
}
return 0;
--
2.5.0
next reply other threads:[~2016-03-16 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 18:31 Nicholas Krause [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-03 23:04 [PATCH] bridge:Fix incorrect variable assignment on error path in br_sysfs_addbr Bastien Philbert
2016-04-04 20:14 ` David Miller
2016-04-04 20:16 ` Bastien Philbert
2016-03-13 2:46 Nicholas Krause
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=1458153077-28586-1-git-send-email-xerofoify@gmail.com \
--to=xerofoify@gmail.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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;
as well as URLs for NNTP newsgroup(s).