mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
nfsd: Fix a file leak on nfsd4_layout_setlease failure
If nfsd4_layout_setlease fails, nfsd will not put ls->ls_file.
Fix commit c5c707f96f
"nfsd: implement pNFS layout recalls".
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
c2227a39a0
commit
1ca4b88e7d
1 changed files with 1 additions and 0 deletions
|
@ -212,6 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
|
|||
BUG_ON(!ls->ls_file);
|
||||
|
||||
if (nfsd4_layout_setlease(ls)) {
|
||||
fput(ls->ls_file);
|
||||
put_nfs4_file(fp);
|
||||
kmem_cache_free(nfs4_layout_stateid_cache, ls);
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue