From: Stephen Hemminger <stephen@networkplumber.org>
To: Pan Bian <bianpan2016@163.com>
Cc: "David S. Miller" <davem@davemloft.net>,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] net: bridge: set error code on failure
Date: Mon, 5 Dec 2016 08:37:18 -0800 [thread overview]
Message-ID: <20161205083718.0c0daa1a@xeon-e3> (raw)
In-Reply-To: <1480764803-5577-1-git-send-email-bianpan2016@163.com>
On Sat, 3 Dec 2016 19:33:23 +0800
Pan Bian <bianpan2016@163.com> wrote:
> Function br_sysfs_addbr() does not set error code when the call
> kobject_create_and_add() returns a NULL pointer. It may be better to
> return "-ENOMEM" when kobject_create_and_add() fails.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188781
>
> Signed-off-by: Pan Bian <bianpan2016@163.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 e120307..f88c4df 100644
> --- a/net/bridge/br_sysfs_br.c
> +++ b/net/bridge/br_sysfs_br.c
> @@ -898,6 +898,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 = -ENOMEM;
> goto out3;
> }
> return 0;
Makes sense. Although such a small allocation should never fail.
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
next prev parent reply other threads:[~2016-12-05 16:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-03 11:33 [PATCH 1/1] net: bridge: set error code on failure Pan Bian
2016-12-05 16:37 ` Stephen Hemminger [this message]
2016-12-05 18:27 ` 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=20161205083718.0c0daa1a@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=bianpan2016@163.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).