From bf935a78814cc9b96d09f612912178adc964ce9c Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Tue, 20 Jan 2009 19:32:59 -0500 Subject: [PATCH] nfsd: fix null dereference on error path We're forgetting to check the return value from groups_alloc(). Signed-off-by: J. Bruce Fields --- fs/nfsd/auth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c index c903e04aa21..b860d3484cd 100644 --- a/fs/nfsd/auth.c +++ b/fs/nfsd/auth.c @@ -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; -- 2.41.0