Re: [PATCH] inet: Avoid unitialized variable warning in inet_unhash()

From: Arnd Bergmann
Date: Thu Feb 01 2018 - 06:49:08 EST


On Thu, Feb 1, 2018 at 11:26 AM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
> With gcc-4.1.2:
>
> net/ipv4/inet_hashtables.c: In function âinet_unhashâ:
> net/ipv4/inet_hashtables.c:628: warning: âilbâ may be used uninitialized in this function
>
> While this is a false positive, it can easily be avoided by using the
> pointer itself as the canary variable.
>
> Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Looks like a reasonable workaround if we care about it. gcc-4.3 and higher
don't seem to produce this warning, so I wouldn't normally care though.

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>