The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] NFSD: fix uninitialized variable
@ 2007-05-27 10:34 Jeff Garzik
  2007-05-29  3:00 ` [NFS] " J. Bruce Fields
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2007-05-27 10:34 UTC (permalink / raw)
  To: Andrew Morton, neilb; +Cc: LKML, nfs


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@garzik.org>

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;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-05-29 19:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-27 10:34 [PATCH] NFSD: fix uninitialized variable Jeff Garzik
2007-05-29  3:00 ` [NFS] " J. Bruce Fields
2007-05-29  3:19   ` Jeff Garzik
2007-05-29  4:31     ` young dave
2007-05-29  7:29       ` Matt Keenan
2007-05-29  8:32         ` young dave
2007-05-29 19:52     ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox