Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b380a7d authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

NFS: Fix a potential NULL dereference in nfs_get_client()



[ Upstream commit 09226e8303beeec10f2ff844d2e46d1371dc58e0 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1ec2dcd6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,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 */