From 2abae55f5a41d29f21b5b259c33d218c950d5c90 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Mon, 23 May 2011 10:02:19 +0200 Subject: cfq-iosched: Fix a memory leak of per cpu stats for root group We allocated per cpu stats struct for root group but did not free it. Fix it. Signed-off-by: Vivek Goyal Signed-off-by: Jens Axboe --- block/cfq-iosched.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'block') diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index d646b279c8b..0316f6eece0 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -3940,6 +3940,11 @@ static void cfq_exit_queue(struct elevator_queue *e) */ if (wait) synchronize_rcu(); + +#ifdef CONFIG_CFQ_GROUP_IOSCHED + /* Free up per cpu stats for root group */ + free_percpu(cfqd->root_group.blkg.stats_cpu); +#endif kfree(cfqd); } -- cgit v1.2.3