From: majianpeng Date: Tue, 29 Jan 2013 05:16:06 +0000 (+0800) Subject: nfsd: Fix memleak X-Git-Tag: v3.2.40~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35ad1797ad99b8e73758c805803021cbda799dcb;p=thirdparty%2Fkernel%2Fstable.git nfsd: Fix memleak commit 2d32b29a1c2830f7c42caa8258c714acd983961f upstream. When free nfs-client, it must free the ->cl_stateids. Signed-off-by: Jianpeng Ma Signed-off-by: J. Bruce Fields Signed-off-by: Ben Hutchings --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8b197d2b84431..7d189dc3d7675 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1009,6 +1009,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); }