mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
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>
This commit is contained in:
parent
26422340da
commit
33c4368ee2
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned int *hashp)
|
||||||
{
|
{
|
||||||
|
*hashp = 0;
|
||||||
|
|
||||||
if (len <= sizeof(short) || len > sizeof(*sunaddr))
|
if (len <= sizeof(short) || len > sizeof(*sunaddr))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (!sunaddr || sunaddr->sun_family != AF_UNIX)
|
if (!sunaddr || sunaddr->sun_family != AF_UNIX)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue