From: Ming Lei Date: Sat, 19 Apr 2014 10:00:16 +0000 (+0800) Subject: blk-mq: free hctx->ctx_map when init failed X-Git-Tag: v3.16-rc1~30^2~49^2~68 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=11471e0d04f3762b9216d8421ce6e9d89b0bf450;p=~emulex%2Finfiniband.git blk-mq: free hctx->ctx_map when init failed Avoid memory leak in the failure path. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index ee225cc312b..5fbbb221d49 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;