[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1539669446-51996-1-git-send-email-kyeongdon.kim@lge.com>
Date: Tue, 16 Oct 2018 14:57:26 +0900
From: Kyeongdon Kim <kyeongdon.kim@....com>
To: davem@...emloft.net, ktkhai@...tuozzo.com, viro@...iv.linux.org.uk,
garsilva@...eddedor.com, jbaron@...mai.com, dvlasenk@...hat.com,
xiyou.wangcong@...il.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kyeongdon.kim@....com
Subject: [PATCH v2] 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@....com>
---
net/unix/af_unix.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index d1edfa3..98d34fb 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)
--
2.6.2
Powered by blists - more mailing lists