[PATCH] NFSD: fix uninitialized variable

From: Jeff Garzik
Date: Sun May 27 2007 - 06:34:56 EST



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 <jeff@xxxxxxxxxx>

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/