From: Serge E. Hallyn Date: Wed, 16 Dec 2009 00:47:27 +0000 (-0800) Subject: ipc ns: fix memory leak (idr) X-Git-Tag: v2.6.27.45~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f653e714dfd24c86d63e6f661a61cd167a2535e6;p=pandora-kernel.git ipc ns: fix memory leak (idr) commit 7d6feeb287c61aafa88f06345387b1188edf4b86 upstream. We have apparently had a memory leak since 7ca7e564e049d8b350ec9d958ff25eaa24226352 "ipc: store ipcs into IDRs" in 2007. The idr of which 3 exist for each ipc namespace is never freed. This patch simply frees them when the ipcns is freed. I don't believe any idr_remove() are done from rcu (and could therefore be delayed until after this idr_destroy()), so the patch should be safe. Some quick testing showed no harm, and the memory leak fixed. Caught by kmemleak. Signed-off-by: Serge E. Hallyn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Acked-by: Nick Piggin Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed