unix: fix build warning of used uninitialized variable
Subsystems (3)
PATCH 1/1 unix: fix build warning of used uninitialized variable
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 protected]>
--- net/unix/af_unix.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
net/unix/af_unix.c +1 -0
@@ -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 )
Signature · 1 line
1.6.0.2
Quoted 13 lines · Wang Weidong
af_unix.c: In functionunix_bind
af_unix.c:893: warning: path may be used uninitialized in this functionSigned-off-by Wang Weidong <[email protected]>--- net/unix/af_unix.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)net/unix/af_unix.c +0
-0
net/unix/af_unix.c static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) · line 899
Quoted 7 lines
net/unix/af_unix.c +1
-0@@ -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 )
You should update your compiler, this patch is not needed.
Quoted 9 lines · Eric Dumazet
Quoted 8 lines · Wang Weidong
af_unix.c: In functionunix_bind
af_unix.c:893: warning: path may be used uninitialized in this functionSigned-off-by Wang Weidong <[email protected]>--- net/unix/af_unix.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 16 lines
net/unix/af_unix.c static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) · line 899
Quoted 12 lines
net/unix/af_unix.c +1
-0@@ -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 )You should update your compiler, this patch is not needed.
Ok.
Thanks!