diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2019-06-11 12:57:52 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-07-06 14:54:53 -0400 |
commit | 9f7761cf0409465075dadb875d5d4b8ef2f890c8 (patch) | |
tree | 3d45759d163d8a875e3173dd8154d54da85556ee /fs/nfs/client.c | |
parent | 9026b3a973b0b0b73c15ba40aff87cd0959fd0f3 (diff) |
NFS: Cleanup if nfs_match_client is interrupted
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>
Diffstat (limited to 'fs/nfs/client.c')
-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 e4fa0a5fd183..30838304a0bf 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -408,10 +408,10 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init) | |||
408 | clp = nfs_match_client(cl_init); | 408 | clp = nfs_match_client(cl_init); |
409 | if (clp) { | 409 | if (clp) { |
410 | spin_unlock(&nn->nfs_client_lock); | 410 | spin_unlock(&nn->nfs_client_lock); |
411 | if (IS_ERR(clp)) | ||
412 | return clp; | ||
413 | if (new) | 411 | if (new) |
414 | new->rpc_ops->free_client(new); | 412 | new->rpc_ops->free_client(new); |
413 | if (IS_ERR(clp)) | ||
414 | return clp; | ||
415 | return nfs_found_client(cl_init, clp); | 415 | return nfs_found_client(cl_init, clp); |
416 | } | 416 | } |
417 | if (new) { | 417 | if (new) { |