summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2011-11-30 15:47:48 +0100
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-01-11 09:23:11 -0800
commit4b0dccaad0b0cc6148b8f2c61f9364f56c35f4fb (patch)
tree8eea05642e6b14b908cce4b24dde69c357d39344 /block
parent23cd227590341dc0573d6d07b162b965e9fc47c6 (diff)
cfq-iosched: free cic_index if blkio_alloc_blkg_stats fails
commit 2984ff38ccf6cbc02a7a996a36c7d6f69f3c6146 upstream. If we fail allocating the blkpg stats, we free cfqd and cfgq. But we need to free the IDA cfqd->cic_index as well. Signed-off-by: majianpeng <majianpeng@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Change-Id: Ie0b58526fabbd53e2343f9ee0474f2070d717967 Reviewed-on: http://git-master/r/74161 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 16ace89613bc..3beed83437a3 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -4036,6 +4036,11 @@ static void *cfq_init_queue(struct request_queue *q)
if (blkio_alloc_blkg_stats(&cfqg->blkg)) {
kfree(cfqg);
+
+ spin_lock(&cic_index_lock);
+ ida_remove(&cic_index_ida, cfqd->cic_index);
+ spin_unlock(&cic_index_lock);
+
kfree(cfqd);
return NULL;
}