summaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorKyeongdon Kim <kyeongdon.kim@lge.com>2018-10-16 07:57:26 +0200
committerDavid S. Miller <davem@davemloft.net>2018-10-18 06:57:28 +0200
commit33c4368ee2589c165aebd8d388cbd91e9adb9688 (patch)
treebe1b1c143ad9e87f7a6b9185ee6cada13d8c42b1 /net/unix/af_unix.c
parentnet: dsa: mv88e6xxx: Fix 88E6141/6341 2500mbps SERDES speed (diff)
downloadlinux-33c4368ee2589c165aebd8d388cbd91e9adb9688.tar.xz
linux-33c4368ee2589c165aebd8d388cbd91e9adb9688.zip
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 <kyeongdon.kim@lge.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index d1edfa3cad61..98d34fb61744 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -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)