Patch Upstream: nfsd: Fix memleak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit: 2d32b29a1c2830f7c42caa8258c714acd983961f
From: majianpeng <majianpeng@xxxxxxxxx>
Date: Tue, 29 Jan 2013 13:16:06 +0800
Subject: nfsd: Fix memleak

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

Cc: stable@xxxxxxxxxx
Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxx>
---
 fs/nfsd/nfs4state.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 4db46aa..a6637de 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1060,6 +1060,8 @@ free_client(struct nfs4_client *clp)
 	}
 	free_svc_cred(&clp->cl_cred);
 	kfree(clp->cl_name.data);
+	idr_remove_all(&clp->cl_stateids);
+	idr_destroy(&clp->cl_stateids);
 	kfree(clp);
 }
 
-- 
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]