diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2019-06-11 12:57:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-04 09:29:38 +0200 |
commit | 7b01a388dc070e0b4b833fe6eca349d0586b5333 (patch) | |
tree | a4a2b793f11c8535ddff5438b74990f57b05dd23 /fs/nfs | |
parent | 3bd37885fea1a0ce57a5b4886e0e3e471bf495d9 (diff) | |
download | linux-stable-7b01a388dc070e0b4b833fe6eca349d0586b5333.tar.gz linux-stable-7b01a388dc070e0b4b833fe6eca349d0586b5333.tar.bz2 linux-stable-7b01a388dc070e0b4b833fe6eca349d0586b5333.zip |
NFS: Cleanup if nfs_match_client is interrupted
commit 9f7761cf0409465075dadb875d5d4b8ef2f890c8 upstream.
Don't bail out before cleaning up a new allocation if the wait for
searching for a matching nfs client is interrupted. Memory leaks.
Reported-by: syzbot+7fe11b49c1cc30e3fce2@syzkaller.appspotmail.com
Fixes: 950a578c6128 ("NFS: make nfs_match_client killable")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index d7e4f0848e28..4d90f5bf0b0a 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -406,10 +406,10 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init) clp = nfs_match_client(cl_init); if (clp) { spin_unlock(&nn->nfs_client_lock); - if (IS_ERR(clp)) - return clp; if (new) new->rpc_ops->free_client(new); + if (IS_ERR(clp)) + return clp; return nfs_found_client(cl_init, clp); } if (new) { |