All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unix: fix build warning of used uninitialized variable
@ 2013-12-06  6:05 Wang Weidong
  2013-12-06  6:24 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Weidong @ 2013-12-06  6:05 UTC (permalink / raw)
  To: David Miller; +Cc: edumazet, ebiederm, gaofeng, jacob.e.keller, netdev

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] unix: fix build warning of used uninitialized variable
  2013-12-06  6:05 [PATCH] unix: fix build warning of used uninitialized variable Wang Weidong
@ 2013-12-06  6:24 ` Eric Dumazet
  2013-12-06  6:38   ` Wang Weidong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-12-06  6:24 UTC (permalink / raw)
  To: Wang Weidong
  Cc: David Miller, edumazet, ebiederm, gaofeng, jacob.e.keller, netdev

On Fri, 2013-12-06 at 14:05 +0800, Wang Weidong wrote:
> 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)

You should update your compiler, this patch is not needed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] unix: fix build warning of used uninitialized variable
  2013-12-06  6:24 ` Eric Dumazet
@ 2013-12-06  6:38   ` Wang Weidong
  0 siblings, 0 replies; 3+ messages in thread
From: Wang Weidong @ 2013-12-06  6:38 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, edumazet, ebiederm, gaofeng, jacob.e.keller, netdev

On 2013/12/6 14:24, Eric Dumazet wrote:
> On Fri, 2013-12-06 at 14:05 +0800, Wang Weidong wrote:
>> 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)
> 
> You should update your compiler, this patch is not needed.
> 
> 
Ok.

Thanks!

> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-06  6:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06  6:05 [PATCH] unix: fix build warning of used uninitialized variable Wang Weidong
2013-12-06  6:24 ` Eric Dumazet
2013-12-06  6:38   ` Wang Weidong

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.