linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@nvidia.com>
To: Zhang Changzhong <zhangchangzhong@huawei.com>,
	Roopa Prabhu <roopa@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: bridge: vlan: fix error return code in __vlan_add()
Date: Fri, 4 Dec 2020 12:47:07 +0200	[thread overview]
Message-ID: <b90689c4-ffa9-d3ca-2cd4-f39e84446639@nvidia.com> (raw)
In-Reply-To: <1607071737-33875-1-git-send-email-zhangchangzhong@huawei.com>

On 04/12/2020 10:48, Zhang Changzhong wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: f8ed289fab84 ("bridge: vlan: use br_vlan_(get|put)_master to deal with refcounts")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
> ---
>  net/bridge/br_vlan.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
> index 3e493eb..08c7741 100644
> --- a/net/bridge/br_vlan.c
> +++ b/net/bridge/br_vlan.c
> @@ -266,8 +266,10 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags,
>  		}
>  
>  		masterv = br_vlan_get_master(br, v->vid, extack);
> -		if (!masterv)
> +		if (!masterv) {
> +			err = -ENOMEM;
>  			goto out_filt;
> +		}
>  		v->brvlan = masterv;
>  		if (br_opt_get(br, BROPT_VLAN_STATS_PER_PORT)) {
>  			v->stats = netdev_alloc_pcpu_stats(struct br_vlan_stats);
> 

Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>


  reply	other threads:[~2020-12-04 10:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  8:48 [PATCH net] net: bridge: vlan: fix error return code in __vlan_add() Zhang Changzhong
2020-12-04 10:47 ` Nikolay Aleksandrov [this message]
2020-12-04 23:42   ` Jakub Kicinski

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=b90689c4-ffa9-d3ca-2cd4-f39e84446639@nvidia.com \
    --to=nikolay@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@nvidia.com \
    --cc=zhangchangzhong@huawei.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;
as well as URLs for NNTP newsgroup(s).