nfsd: fix null dereference on error path
authorJ. Bruce Fields <bfields@fieldses.org>
Wed, 21 Jan 2009 00:32:59 +0000 (19:32 -0500)
committerJ. Bruce Fields <bfields@pig.fieldses.org>
Tue, 27 Jan 2009 22:26:58 +0000 (17:26 -0500)
We're forgetting to check the return value from groups_alloc().

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/auth.c

index c903e04..b860d34 100644 (file)
@@ -49,6 +49,8 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
                new->fsuid = exp->ex_anon_uid;
                new->fsgid = exp->ex_anon_gid;
                gi = groups_alloc(0);
+               if (!gi)
+                       goto oom;
        } else if (flags & NFSEXP_ROOTSQUASH) {
                if (!new->fsuid)
                        new->fsuid = exp->ex_anon_uid;