lkml.org 
[lkml]   [2017]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] [net] net/mlx5e: fix another -Wmaybe-uninitialized warning
From
Date
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.

\
 
 \ /
  Last update: 2017-01-12 09:32    [W:0.074 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site