Commit 2a5cac17c06f897537f91f0040b3d3c8177f6433
Committed by
Linus Torvalds
1 parent
0fccc62218
Exists in
master
and in
20 other branches
fs/ncpfs/inode.c: suppress used-uninitialised warning
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 <jiaweiwei.xiyou@gmail.com> Cc: Petr Vandrovec <petr@vandrovec.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff
fs/ncpfs/inode.c
... | ... | @@ -461,7 +461,7 @@ |
461 | 461 | #endif |
462 | 462 | struct ncp_entry_info finfo; |
463 | 463 | |
464 | - data.wdog_pid = NULL; | |
464 | + memset(&data, 0, sizeof(data)); | |
465 | 465 | server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL); |
466 | 466 | if (!server) |
467 | 467 | return -ENOMEM; |
... | ... | @@ -496,7 +496,6 @@ |
496 | 496 | struct ncp_mount_data_v4* md = (struct ncp_mount_data_v4*)raw_data; |
497 | 497 | |
498 | 498 | data.flags = md->flags; |
499 | - data.int_flags = 0; | |
500 | 499 | data.mounted_uid = md->mounted_uid; |
501 | 500 | data.wdog_pid = find_get_pid(md->wdog_pid); |
502 | 501 | data.ncp_fd = md->ncp_fd; |
... | ... | @@ -507,7 +506,6 @@ |
507 | 506 | data.file_mode = md->file_mode; |
508 | 507 | data.dir_mode = md->dir_mode; |
509 | 508 | data.info_fd = -1; |
510 | - data.mounted_vol[0] = 0; | |
511 | 509 | } |
512 | 510 | break; |
513 | 511 | default: |