Commit 9f7761cf authored by Benjamin Coddington's avatar Benjamin Coddington Committed by Trond Myklebust
Browse files

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: default avatar <syzbot+7fe11b49c1cc30e3fce2@syzkaller.appspotmail.com>
Fixes: 950a578c ("NFS: make nfs_match_client killable")
Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 9026b3a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -408,10 +408,10 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init)
		clp = nfs_match_client(cl_init);
		clp = nfs_match_client(cl_init);
		if (clp) {
		if (clp) {
			spin_unlock(&nn->nfs_client_lock);
			spin_unlock(&nn->nfs_client_lock);
			if (IS_ERR(clp))
				return clp;
			if (new)
			if (new)
				new->rpc_ops->free_client(new);
				new->rpc_ops->free_client(new);
			if (IS_ERR(clp))
				return clp;
			return nfs_found_client(cl_init, clp);
			return nfs_found_client(cl_init, clp);
		}
		}
		if (new) {
		if (new) {