af_unix: fix build warning
Subsystems (3)
PATCH 1/1 af_unix: fix build warning
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
--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/af_unix.c +1 -1
@@ -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);
Signature · 1 line
1.8.0
Hi,
Which version of gcc are you using ?
A patch like yours, for the same method, unix_bind(), was sent in the past, and Stephen Hemminger noted the
with gcc 4.7 the warning you got does not occur.
see:
http://permalink.gmane.org/gmane.linux.network/247807
Best Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen
Quoted 29 lines · dingtianhong
net/unix/af_unix.c: In function ‘unix_bind’:net/unix/af_unix.c:892: warning: ‘path.mnt’ may be used uninitialized in this functionnet/unix/af_unix.c:892: warning: ‘path.dentry’ may be used uninitialized in this functionSigned-off-by Ding Tianhong <[email protected]>--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/unix/af_unix.c +1
-2@@ -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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Rami Rosen
Hi,
Which version of gcc are you using ?
A patch like yours, for the same method,unix_bind(), was sent in the past, and Stephen Hemminger noted the
with gcc 4.7 the warning you got does not occur.
see:
http://permalink.gmane.org/gmane.linux.network/247807
Quoted 5 lines
Best Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen
ok,thanks
Quoted 33 lines · dingtianhong
Quoted 29 lines
net/unix/af_unix.c: In function ‘unix_bind’:net/unix/af_unix.c:892: warning: ‘path.mnt’ may be used uninitialized in this functionnet/unix/af_unix.c:892: warning: ‘path.dentry’ may be used uninitialized in this functionSigned-off-by Ding Tianhong <[email protected]>--- net/unix/af_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/unix/af_unix.c +1
-2@@ -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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html