From: David Howells Date: Sun, 30 Jul 2006 18:40:56 +0000 (-0400) Subject: NFS: Fix error handling X-Git-Tag: v2.6.19-rc1~1271^2~51 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ba851244f627a302d0fc6469d1ad413fc34fcb;p=linux-2.6 NFS: Fix error handling Fix an error handling problem: nfs_put_client() can be given a NULL pointer if nfs_free_server() is asked to destroy a partially initialised record. Signed-Off-By: David Howells Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 27f6478144..700bd58012 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -208,6 +208,9 @@ static void nfs_free_client(struct nfs_client *clp) */ void nfs_put_client(struct nfs_client *clp) { + if (!clp) + return; + dprintk("--> nfs_put_client({%d})\n", atomic_read(&clp->cl_count)); if (atomic_dec_and_lock(&clp->cl_count, &nfs_client_lock)) {