Skip to content

Commit 33c4368

Browse files
Kyeongdon Kimdavem330
authored andcommitted
net: fix warning in af_unix
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2642234 commit 33c4368

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/unix/af_unix.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ static inline void unix_release_addr(struct unix_address *addr)
225225

226226
static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned int *hashp)
227227
{
228+
*hashp = 0;
229+
228230
if (len <= sizeof(short) || len > sizeof(*sunaddr))
229231
return -EINVAL;
230232
if (!sunaddr || sunaddr->sun_family != AF_UNIX)

0 commit comments

Comments
 (0)