Re: [PATCH] net: fix waring in af_unix

From: David Miller
Date: Tue Oct 16 2018 - 01:16:06 EST


From: Kyeongdon Kim <kyeongdon.kim@xxxxxxx>
Date: Fri, 12 Oct 2018 19:34:14 +0900

> This fixes the "'hash' may be used uninitialized in this function"
>
> net/unix/af_unix.c:1041:20: warning: 'hash' may be used uninitialized in this function [-Wmaybe-uninitialized]
> addr->hash = hash ^ sk->sk_type;
> ^
>
> Signed-off-by: Kyeongdon Kim <kyeongdon.kim@xxxxxxx>

Please put the initialization at the start of unix_mkname() as a similar
situation exists elsewhere in this file, and the compiler will eventually
warn there too.