aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2011-11-30 09:47:48 -0500
committerJens Axboe <axboe@kernel.dk>2011-11-30 09:47:48 -0500
commit2984ff38ccf6cbc02a7a996a36c7d6f69f3c6146 (patch)
tree95f4803da220a899cfb840fbbc1eb74e1b8ba003 /block/cfq-iosched.c
parent59bd71a81b66990564eac69aedd28ad87a2c81f4 (diff)
cfq-iosched: free cic_index if blkio_alloc_blkg_stats fails
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> Cc: stable@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/cfq-iosched.c')
-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 16ace89613b..3beed83437a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -4036,6 +4036,11 @@ static void *cfq_init_queue(struct request_queue *q)
4036 4036
4037 if (blkio_alloc_blkg_stats(&cfqg->blkg)) { 4037 if (blkio_alloc_blkg_stats(&cfqg->blkg)) {
4038 kfree(cfqg); 4038 kfree(cfqg);
4039
4040 spin_lock(&cic_index_lock);
4041 ida_remove(&cic_index_ida, cfqd->cic_index);
4042 spin_unlock(&cic_index_lock);
4043
4039 kfree(cfqd); 4044 kfree(cfqd);
4040 return NULL; 4045 return NULL;
4041 } 4046 }