From 698d8d875a0593f65092f6619d97de49bc5caa45 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 9 Nov 2012 15:31:53 -0500 Subject: [PATCH] nfsd: fix error handling in nfsd4_remove_clid_dir If the credential save fails, then we'll leak our mnt_want_write_file reference. Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields --- fs/nfsd/nfs4recover.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 43295d45cc2b..0f1e2e21f7d9 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -301,12 +301,13 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp) status = nfs4_save_creds(&original_cred); if (status < 0) - goto out; + goto out_drop_write; status = nfsd4_unlink_clid_dir(clp->cl_recdir, HEXDIR_LEN-1); nfs4_reset_creds(original_cred); if (status == 0) vfs_fsync(rec_file, 0); +out_drop_write: mnt_drop_write_file(rec_file); out: if (status) -- GitLab