diff options
| author | Shenghui Wang <shhuiw@foxmail.com> | 2019-04-01 09:40:36 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2019-04-02 10:20:06 -0400 |
| commit | b9a1ff504b9492ad6beb7d5606e0e3365d4d8499 (patch) | |
| tree | fe67ce2d34f93cddbebcd8b4abd4b0df15f1d808 | |
| parent | 42b1bd33dcdef4ffd98f695e188bab82f9fa46d8 (diff) | |
block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
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>
| -rw-r--r-- | block/blk-mq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 3ff3d7b49969..f3b0d33bdf88 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -2332,7 +2332,7 @@ static int blk_mq_init_hctx(struct request_queue *q, | |||
| 2332 | return 0; | 2332 | return 0; |
| 2333 | 2333 | ||
| 2334 | free_fq: | 2334 | free_fq: |
| 2335 | kfree(hctx->fq); | 2335 | blk_free_flush_queue(hctx->fq); |
| 2336 | exit_hctx: | 2336 | exit_hctx: |
| 2337 | if (set->ops->exit_hctx) | 2337 | if (set->ops->exit_hctx) |
| 2338 | set->ops->exit_hctx(hctx, hctx_idx); | 2338 | set->ops->exit_hctx(hctx, hctx_idx); |
