Skip to content

Commit

Permalink
net: fix warning in af_unix
Browse files Browse the repository at this point in the history
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@lge.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kyeongdon Kim authored and David S. Miller committed Oct 18, 2018
1 parent 2642234 commit 33c4368
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ static inline void unix_release_addr(struct unix_address *addr)

static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned int *hashp)
{
*hashp = 0;

if (len <= sizeof(short) || len > sizeof(*sunaddr))
return -EINVAL;
if (!sunaddr || sunaddr->sun_family != AF_UNIX)
Expand Down

0 comments on commit 33c4368

Please sign in to comment.