Commit 2abae55f authored by Vivek Goyal's avatar Vivek Goyal Committed by Jens Axboe
Browse files

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: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 345227d7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
}