All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wei <jiaweiwei.xiyou@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: tim.gardner@canonical.com, linux-kernel@vger.kernel.org,
	petr@vandrovec.name, viro@zeniv.linux.org.uk, arnd@arndb.de,
	npiggin@kernel.dk, jens.axboe@oracle.com, greg@kroah.com,
	joe@perches.com
Subject: Re: [PATCH]initialize the array of fs/ncpfs/inode.c
Date: Tue, 12 Apr 2011 11:17:39 +0800	[thread overview]
Message-ID: <20110412031736.GA3155@gmail.com> (raw)
In-Reply-To: <20110411161838.dabbc3f3.akpm@linux-foundation.org>

On Mon, Apr 11, 2011 at 04:18:38PM -0700, Andrew Morton wrote:
> On Sun, 10 Apr 2011 18:08:18 +0800
> Harry Wei <jiaweiwei.xiyou@gmail.com> wrote:
> 
> > fs/ncpfs/inode.c: In function 'ncp_fill_super':
> > fs/ncpfs/inode.c:451: warning: 'data.mounted_vol[1u]' may be used 
> 
> It's notabug, but we can easily fix it with a memset().
> 
> Reported-by: Harry Wei <jiaweiwei.xiyou@gmail.com>
> Cc: Petr Vandrovec <petr@vandrovec.name>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  fs/ncpfs/inode.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>  
> -	data.wdog_pid = NULL;
> +	memset(data, 0, sizeof(data));
Hi Morton,
	It really need a '&' for data, i think. So i have corrected
your patch like following.

Thanks.
Harry Wei.

Reported-by: Harry Wei <jiaweiwei.xiyou@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Harry Wei <jiaweiwei.xiyou@gmail.com>
---

 fs/ncpfs/inode.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff -puN fs/ncpfs/inode.c~fs-ncpfs-inodec-suppress-used-uninitialised-warning fs/ncpfs/inode.c
--- a/fs/ncpfs/inode.c~fs-ncpfs-inodec-suppress-used-uninitialised-warning
+++ a/fs/ncpfs/inode.c
@@ -461,7 +461,7 @@ static int ncp_fill_super(struct super_b
 #endif
       struct ncp_entry_info finfo;

-      data.wdog_pid = NULL;
+       memset(&data, 0, sizeof(data));
       server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL);
       if (!server)
		return -ENOMEM;
@@ -496,7 +496,6 @@ static int ncp_fill_super(struct super_b
                               struct ncp_mount_data_v4* md = (struct ncp_mount_data_v4*)raw_data;

                               data.flags = md->flags;
-                               data.int_flags = 0;
                               data.mounted_uid = md->mounted_uid;
                               data.wdog_pid = find_get_pid(md->wdog_pid);
                               data.ncp_fd = md->ncp_fd;
@@ -507,7 +506,6 @@ static int ncp_fill_super(struct super_b
                               data.file_mode = md->file_mode;
                               data.dir_mode = md->dir_mode;
                               data.info_fd = -1;
-                               data.mounted_vol[0] = 0;
                       }
                       break;
               default:
_


      parent reply	other threads:[~2011-04-12  3:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 10:08 [PATCH]initialize the array of fs/ncpfs/inode.c Harry Wei
2011-04-11 23:18 ` Andrew Morton
2011-04-11 23:28   ` Tim Gardner
2011-04-12  3:17   ` Harry Wei [this message]

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=20110412031736.GA3155@gmail.com \
    --to=jiaweiwei.xiyou@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=greg@kroah.com \
    --cc=jens.axboe@oracle.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@kernel.dk \
    --cc=petr@vandrovec.name \
    --cc=tim.gardner@canonical.com \
    --cc=viro@zeniv.linux.org.uk \
    /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.