]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
authorShenghui Wang <shhuiw@foxmail.com>
Mon, 1 Apr 2019 13:40:36 +0000 (21:40 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838459
[ 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 <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
block/blk-mq.c

index 7384bb7335331a6eeb514c54624a24f07ac87e81..77235cb5748093895e7efdb6d1965dc4f5bb86b6 100644 (file)
@@ -2164,7 +2164,7 @@ static int blk_mq_init_hctx(struct request_queue *q,
        return 0;
 
  free_fq:
-       kfree(hctx->fq);
+       blk_free_flush_queue(hctx->fq);
  sched_exit_hctx:
        blk_mq_sched_exit_hctx(q, hctx, hctx_idx);
  exit_hctx: