[PATCH] NFSD: fix uninitialized variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Unlike many of the bogus warnings spewed by gcc, this one actually
complains about a real bug:

fs/nfsd/nfs4acl.c: In function ‘_posix_to_nfsv4_one’:
fs/nfsd/nfs4acl.c:227: warning: ‘pas.owner’ may be used uninitialized in this function
fs/nfsd/nfs4acl.c:227: warning: ‘pas.group’ may be used uninitialized in this function
fs/nfsd/nfs4acl.c:227: warning: ‘pas.other’ may be used uninitialized in this function

Signed-off-by: Jeff Garzik <[email protected]>

diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index cc3b7ba..7fd4d44 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -183,8 +183,8 @@ static void
 summarize_posix_acl(struct posix_acl *acl, struct posix_acl_summary *pas)
 {
 	struct posix_acl_entry *pa, *pe;
-	pas->users = 0;
-	pas->groups = 0;
+
+	memset(pas, 0, sizeof(*pas));
 	pas->mask = 07;
 
 	pe = acl->a_entries + acl->a_count;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux