Skip to content

Commit

Permalink
cfq-iosched: Fix a memory leak of per cpu stats for root group
Browse files Browse the repository at this point in the history
We allocated per cpu stats struct for root group but did not free it.
Fix it.

Signed-off-by: Vivek Goyal <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
rhvgoyal authored and Jens Axboe committed May 23, 2011
1 parent 345227d commit 2abae55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 2abae55

Please sign in to comment.