public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Saeed Mahameed <saeedm@mellanox.com>,
	Hadar Hen Zion <hadarh@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [net] net/mlx5e: fix another -Wmaybe-uninitialized warning
Date: Thu, 12 Jan 2017 10:30:24 +0200	[thread overview]
Message-ID: <5cc9060f-6802-8634-f144-4637e9576ef1@mellanox.com> (raw)
In-Reply-To: <20170111211451.2705705-1-arnd@arndb.de>

On 1/11/2017 11:14 PM, Arnd Bergmann wrote:
> @@ -666,14 +666,15 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv,
>   	struct rtable *rt;
>   	struct neighbour *n = NULL;
>   	int ttl;
> +	int ret;
> +
> +	if (!IS_ENABLED(CONFIG_INET))
> +		return -EOPNOTSUPP;
>   
> -#if IS_ENABLED(CONFIG_INET)
>   	rt = ip_route_output_key(dev_net(mirred_dev), fl4);
> -	if (IS_ERR(rt))
> -		return PTR_ERR(rt);
> -#else
> -	return -EOPNOTSUPP;
> -#endif
> +	ret = PTR_ERR_OR_ZERO(rt);
> +	if (ret)
> +		return ret;

but this means that if we got NULL from ip_route_output_key, we will 
return success (0) here which is wrong.

  reply	other threads:[~2017-01-12  8:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 21:14 [PATCH] [net] net/mlx5e: fix another -Wmaybe-uninitialized warning Arnd Bergmann
2017-01-12  8:30 ` Or Gerlitz [this message]
2017-01-12 10:10   ` Arnd Bergmann
2017-01-12 15:21 ` Or Gerlitz
2017-01-12 16:04   ` Arnd Bergmann
2017-01-12 20:55     ` Or Gerlitz

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=5cc9060f-6802-8634-f144-4637e9576ef1@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=hadarh@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.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