Commit 09226e83 authored by Dan Carpenter's avatar Dan Carpenter Committed by Trond Myklebust
Browse files

NFS: Fix a potential NULL dereference in nfs_get_client()



None of the callers are expecting NULL returns from nfs_get_client() so
this code will lead to an Oops.  It's better to return an error
pointer.  I expect that this is dead code so hopefully no one is
affected.

Fixes: 31434f49 ("nfs: check hostname in nfs_get_client")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 476bdb04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ struct nfs_client *nfs_get_client(const struct nfs_client_initdata *cl_init)

	if (cl_init->hostname == NULL) {
		WARN_ON(1);
		return NULL;
		return ERR_PTR(-EINVAL);
	}

	/* see if the client already exists */