diff options
author | majianpeng <majianpeng@gmail.com> | 2011-11-30 15:47:48 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-06 14:13:46 -0800 |
commit | 8f8a594251e5260f53d746887890d0d2185ceebb (patch) | |
tree | fe49c65525bc1599823f4dc43569c69c6c36c862 /block | |
parent | 183647b865aea1411c87f9b76b8c74511e34807d (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>
Diffstat (limited to 'block')
-rw-r--r-- | block/cfq-iosched.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index ae21919f15e1..aae94473b581 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -4015,6 +4015,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; } |