Commit 027bc41a3eb4759d60641c033c9a4c85be1cfd39

Authored by Kinglong Mee
Committed by J. Bruce Fields
1 parent 13c82e8eb5

NFSD: Put export if prepare_creds() fail

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff

... ... @@ -209,8 +209,10 @@
209 209 * fix that case easily.
210 210 */
211 211 struct cred *new = prepare_creds();
212   - if (!new)
213   - return nfserrno(-ENOMEM);
  212 + if (!new) {
  213 + error = nfserrno(-ENOMEM);
  214 + goto out;
  215 + }
214 216 new->cap_effective =
215 217 cap_raise_nfsd_set(new->cap_effective,
216 218 new->cap_permitted);