diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index de6bab641b20..2092c14f1dc2 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -638,6 +638,8 @@ nfsd_map_name_to_uid(struct svc_rqst *rqstp, const char *name, size_t namelen, return nfserr_inval; status = do_name_to_id(rqstp, IDMAP_TYPE_USER, name, namelen, &id); + if (status) + return status; *uid = make_kuid(&init_user_ns, id); if (!uid_valid(*uid)) status = nfserr_badowner; @@ -655,6 +657,8 @@ nfsd_map_name_to_gid(struct svc_rqst *rqstp, const char *name, size_t namelen, return nfserr_inval; status = do_name_to_id(rqstp, IDMAP_TYPE_GROUP, name, namelen, &id); + if (status) + return status; *gid = make_kgid(&init_user_ns, id); if (!gid_valid(*gid)) status = nfserr_badowner;