]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: fix warning in af_unix
authorKyeongdon Kim <kyeongdon.kim@lge.com>
Tue, 16 Oct 2018 05:57:26 +0000 (14:57 +0900)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:20:50 +0000 (14:20 -0300)
BugLink: https://bugs.launchpad.net/bugs/1854975
[ Upstream commit 33c4368ee2589c165aebd8d388cbd91e9adb9688 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/unix/af_unix.c

index e5d49a5cf6cc3b786b080800c61dad8989281f59..19dc158127ca765695d2de33e67d9ad398593f76 100644 (file)
@@ -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)