Instead of freeing individual pages of the bitmap for the namespace,
call idr_destroy() on the idr struct for the namespace.

Signed-off-by: Gargi Sharma <gs051...@gmail.com>
---
 kernel/pid_namespace.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 74a5a72..6894109 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -164,11 +164,9 @@ static void delayed_free_pidns(struct rcu_head *p)
 
 static void destroy_pid_namespace(struct pid_namespace *ns)
 {
-       int i;
-
        ns_free_inum(&ns->ns);
-       for (i = 0; i < PIDMAP_ENTRIES; i++)
-               kfree(ns->pidmap[i].page);
+
+       idr_destroy(ns->idr);
        call_rcu(&ns->rcu, delayed_free_pidns);
 }
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to