Commit 2984ff38 authored by majianpeng's avatar majianpeng Committed by Jens Axboe

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: default avatarmajianpeng <majianpeng@gmail.com>
Cc: stable@kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 59bd71a8
...@@ -4036,6 +4036,11 @@ static void *cfq_init_queue(struct request_queue *q) ...@@ -4036,6 +4036,11 @@ static void *cfq_init_queue(struct request_queue *q)
if (blkio_alloc_blkg_stats(&cfqg->blkg)) { if (blkio_alloc_blkg_stats(&cfqg->blkg)) {
kfree(cfqg); kfree(cfqg);
spin_lock(&cic_index_lock);
ida_remove(&cic_index_ida, cfqd->cic_index);
spin_unlock(&cic_index_lock);
kfree(cfqd); kfree(cfqd);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment