Skip to content

Commit

Permalink
NFSv4: Ensure that nfs4_alloc_client cleans up on error.
Browse files Browse the repository at this point in the history
Any pointer that was allocated through nfs_alloc_client() needs to be
freed via a call to nfs_free_client().

Reported-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 20, 2012
1 parent 12dfd08 commit 7653f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/nfs4client.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init)
return clp;

error:
kfree(clp);
nfs_free_client(clp);
return ERR_PTR(err);
}

Expand Down

0 comments on commit 7653f6f

Please sign in to comment.