aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-07-30 14:40:56 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-09-22 23:24:37 -0400
commit27ba851244f627a302d0fc6469d1ad413fc34fcb (patch)
tree383016ee3e96fe7acf62067bda1ed70371ab4640 /fs
parent6aaca566503296a73f956908ec98173946134fe2 (diff)
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 <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/client.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 27f64781444a..700bd5801223 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -208,6 +208,9 @@ static void nfs_free_client(struct nfs_client *clp)
208 */ 208 */
209void nfs_put_client(struct nfs_client *clp) 209void nfs_put_client(struct nfs_client *clp)
210{ 210{
211 if (!clp)
212 return;
213
211 dprintk("--> nfs_put_client({%d})\n", atomic_read(&clp->cl_count)); 214 dprintk("--> nfs_put_client({%d})\n", atomic_read(&clp->cl_count));
212 215
213 if (atomic_dec_and_lock(&clp->cl_count, &nfs_client_lock)) { 216 if (atomic_dec_and_lock(&clp->cl_count, &nfs_client_lock)) {