]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
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 c903e04aa2171d7f0c42ea7494fe794f6dd9f5f2..b860d3484cd75157c8a652e23047f79fb18f8ba9 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;