public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Wang Weidong <wangweidong1@huawei•com>
To: David Miller <davem@davemloft•net>
Cc: <edumazet@google•com>, <ebiederm@xmission•com>,
	<gaofeng@cn•fujitsu.com>, <jacob.e.keller@intel•com>,
	<netdev@vger•kernel.org>
Subject: [PATCH] unix: fix build warning of used uninitialized variable
Date: Fri, 6 Dec 2013 14:05:24 +0800	[thread overview]
Message-ID: <52A16924.9050407@huawei.com> (raw)

af_unix.c: In function unix_bind
af_unix.c:893: warning: path may be used uninitialized in this function

Signed-off-by: Wang Weidong <wangweidong1@huawei•com>
---
 net/unix/af_unix.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 01625cc..4155ed3 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -893,6 +893,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 		struct path path;
 		umode_t mode = S_IFSOCK |
 		       (SOCK_INODE(sock)->i_mode & ~current_umask());
+		memset(&path, 0, sizeof(path));
 		err = unix_mknod(sun_path, mode, &path);
 		if (err) {
 			if (err == -EEXIST)
-- 
1.6.0.2

             reply	other threads:[~2013-12-06  6:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06  6:05 Wang Weidong [this message]
2013-12-06  6:24 ` [PATCH] unix: fix build warning of used uninitialized variable Eric Dumazet
2013-12-06  6:38   ` Wang Weidong

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=52A16924.9050407@huawei.com \
    --to=wangweidong1@huawei$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=edumazet@google$(echo .)com \
    --cc=gaofeng@cn$(echo .)fujitsu.com \
    --cc=jacob.e.keller@intel$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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