NFS: Fix a potential NULL dereference in nfs_get_client()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 3 Jun 2021 12:37:53 +0000 (15:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jun 2021 10:01:46 +0000 (12:01 +0200)
commit279ad78a00f8b9c5ff24171a59297187a3bd44b7
treeaefdf019e46444386f79329e0d51d446e9295027
parent91f7fdc4cc10542ca1045c06aad23365f0d067e0
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: 31434f496abb ("nfs: check hostname in nfs_get_client")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/client.c