]> git.hungrycats.org Git - linux/commitdiff
nfsd: Fix memleak
authormajianpeng <majianpeng@gmail.com>
Tue, 29 Jan 2013 05:16:06 +0000 (13:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Mar 2013 22:06:42 +0000 (06:06 +0800)
commit 2d32b29a1c2830f7c42caa8258c714acd983961f upstream.

When free nfs-client, it must free the ->cl_stateids.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4state.c

index 537731e4c160644fc8368e1516544495670d9b46..abd785e5fd2d00ba4234f98ce6902bd475416d02 100644 (file)
@@ -1053,6 +1053,8 @@ free_client(struct nfs4_client *clp)
                put_group_info(clp->cl_cred.cr_group_info);
        kfree(clp->cl_principal);
        kfree(clp->cl_name.data);
+       idr_remove_all(&clp->cl_stateids);
+       idr_destroy(&clp->cl_stateids);
        kfree(clp);
 }