Skip to content

Commit

Permalink
NFS: Fix error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Howells authored and Trond Myklebust committed Sep 23, 2006
1 parent 6aaca56 commit 27ba851
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 27ba851

Please sign in to comment.