linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyeongdon Kim <kyeongdon.kim@lge.com>
To: davem@davemloft.net, ktkhai@virtuozzo.com,
	viro@zeniv.linux.org.uk, garsilva@embeddedor.com,
	jbaron@akamai.com, dvlasenk@redhat.com, xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kyeongdon.kim@lge.com
Subject: [PATCH] net: fix waring in af_unix
Date: Fri, 12 Oct 2018 19:34:14 +0900	[thread overview]
Message-ID: <1539340454-67970-1-git-send-email-kyeongdon.kim@lge.com> (raw)

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>
---
 net/unix/af_unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index d1edfa3..e6cecc8 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -989,7 +989,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 	struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr;
 	char *sun_path = sunaddr->sun_path;
 	int err;
-	unsigned int hash;
+	unsigned int hash = 0;
 	struct unix_address *addr;
 	struct hlist_head *list;
 	struct path path = { };
-- 
2.6.2


             reply	other threads:[~2018-10-12 10:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 10:34 Kyeongdon Kim [this message]
2018-10-16  5:16 ` [PATCH] net: fix waring in af_unix David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1539340454-67970-1-git-send-email-kyeongdon.kim@lge.com \
    --to=kyeongdon.kim@lge.com \
    --cc=davem@davemloft.net \
    --cc=dvlasenk@redhat.com \
    --cc=garsilva@embeddedor.com \
    --cc=jbaron@akamai.com \
    --cc=ktkhai@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).