mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
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>
This commit is contained in:
parent
dc4a93078b
commit
11471e0d04
1 changed files with 1 additions and 0 deletions
|
@ -1289,6 +1289,7 @@ static int blk_mq_init_hw_queues(struct request_queue *q,
|
||||||
|
|
||||||
blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
|
blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
|
||||||
kfree(hctx->ctxs);
|
kfree(hctx->ctxs);
|
||||||
|
kfree(hctx->ctx_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue