summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenghui Wang <shhuiw@foxmail.com>2019-04-01 16:40:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 08:22:52 +0300
commitb514ad765acbcd8d2784fff67b9f218b7fa4a33a (patch)
tree7407d1f9f80e1e669680d97244864c48b063d5f3
parent93a122ae03805e3884fa563cf621a779d342e199 (diff)
downloadlinux-b514ad765acbcd8d2784fff67b9f218b7fa4a33a.tar.xz
block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
[ Upstream commit b9a1ff504b9492ad6beb7d5606e0e3365d4d8499 ] kfree() can leak the hctx->fq->flush_rq field. Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
-rw-r--r--block/blk-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 16f9675c57e6..97eba6d23425 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2341,7 +2341,7 @@ static int blk_mq_init_hctx(struct request_queue *q,
return 0;
free_fq:
- kfree(hctx->fq);
+ blk_free_flush_queue(hctx->fq);
exit_hctx:
if (set->ops->exit_hctx)
set->ops->exit_hctx(hctx, hctx_idx);