Subject: [PATCH] unix: fix build warning of used uninitialized variable

From: Wang Weidong <[email-masked]>
Date: Fri, 6 Dec 2013 14:05:24 +0800

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 <[email-masked]>
---
 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