summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2014-04-19 18:00:16 +0800
committerJens Axboe <axboe@fb.com>2014-04-21 10:38:34 -0600
commit11471e0d04f3762b9216d8421ce6e9d89b0bf450 (patch)
tree1127998724da07ee384d3464812d60d94f311284 /block
parentdc4a93078b8a6a10d2dcaba76ab488d6dbe73922 (diff)
downloadlinux-stable-11471e0d04f3762b9216d8421ce6e9d89b0bf450.tar.gz
linux-stable-11471e0d04f3762b9216d8421ce6e9d89b0bf450.tar.bz2
linux-stable-11471e0d04f3762b9216d8421ce6e9d89b0bf450.zip
blk-mq: free hctx->ctx_map when init failed
Avoid memory leak in the failure path. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index ee225cc312b8..5fbbb221d499 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1289,6 +1289,7 @@ static int blk_mq_init_hw_queues(struct request_queue *q,
blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
kfree(hctx->ctxs);
+ kfree(hctx->ctx_map);
}
return 1;