Skip to content

Commit

Permalink
fs/ncpfs/inode.c: suppress used-uninitialised warning
Browse files Browse the repository at this point in the history
We get this spurious warning:

  fs/ncpfs/inode.c: In function 'ncp_fill_super':
  fs/ncpfs/inode.c:451: warning: 'data.mounted_vol[1u]' may be used uninitialized in this function
  fs/ncpfs/inode.c:451: warning: 'data.mounted_vol[2u]' may be used uninitialized in this function
  fs/ncpfs/inode.c:451: warning: 'data.mounted_vol[3u]' may be used uninitialized in this function
  ...

It's notabug, but we can easily fix it with a memset().

Reported-by: Harry Wei <[email protected]>
Cc: Petr Vandrovec <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed May 25, 2011
1 parent 0fccc62 commit 2a5cac1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/ncpfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
#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;
Expand Down Expand Up @@ -496,7 +496,6 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
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;
Expand All @@ -507,7 +506,6 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
data.file_mode = md->file_mode;
data.dir_mode = md->dir_mode;
data.info_fd = -1;
data.mounted_vol[0] = 0;
}
break;
default:
Expand Down

0 comments on commit 2a5cac1

Please sign in to comment.