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: 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>

authored by Dan Carpenter and committed by Trond Myklebust 09226e83 476bdb04

+1 -1
+1 -1
fs/nfs/client.c
··· 406 407 if (cl_init->hostname == NULL) { 408 WARN_ON(1); 409 - return NULL; 410 } 411 412 /* see if the client already exists */
··· 406 407 if (cl_init->hostname == NULL) { 408 WARN_ON(1); 409 + return ERR_PTR(-EINVAL); 410 } 411 412 /* see if the client already exists */