All of lore.kernel.org
 help / color / mirror / Atom feed
From: dingtianhong <dingtianhong@huawei.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>, <netdev@vger.kernel.org>,
	Li Zefan <lizefan@huawei.com>
Subject: [PATCH] af_unix: fix build warning
Date: Wed, 3 Apr 2013 17:31:06 +0800	[thread overview]
Message-ID: <515BF6DA.9010007@huawei.com> (raw)

net/unix/af_unix.c: In function ‘unix_bind’:
net/unix/af_unix.c:892: warning: ‘path.mnt’ may be used uninitialized in this function
net/unix/af_unix.c:892: warning: ‘path.dentry’ may be used uninitialized in this function

Signed-off-by: Ding Tianhong <dingtianhong@huawei.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 971282b..3ccc049 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -889,7 +889,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 	atomic_set(&addr->refcnt, 1);

 	if (sun_path[0]) {
-		struct path path;
+		struct path path = {};
 		umode_t mode = S_IFSOCK |
 		       (SOCK_INODE(sock)->i_mode & ~current_umask());
 		err = unix_mknod(sun_path, mode, &path);
-- 
1.8.0

             reply	other threads:[~2013-04-03  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03  9:31 dingtianhong [this message]
2013-04-03 12:27 ` [PATCH] af_unix: fix build warning Rami Rosen
2013-04-04  7:00   ` dingtianhong

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=515BF6DA.9010007@huawei.com \
    --to=dingtianhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.