block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
PATCH 1/1 block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
kfree() can leak the hctx->fq->flush_rq field.
Signed-off-by Shenghui Wang <[email protected]>
--- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.c +1 -1
@@ -2332,7 +2332,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);
Signature · 1 line
2.20.1
Quoted 13 lines · Shenghui Wang
kfree()can leak thehctx->fq->flush_rqfield.Signed-off-by Shenghui Wang <[email protected]>--- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/blk-mq.c +0
-0
block/blk-mq.c static int blk_mq_init_hctx(struct request_queue *q, · line 2338
Quoted 8 lines
block/blk-mq.c +1
-1@@ -2332,7 +2332,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);
Reviewed-by Ming Lei <[email protected]>
Thanks,
Ming Lei
Quoted 1 line · Shenghui Wang
kfree()can leak thehctx->fq->flush_rqfield.
Applied, thanks.
Signature · 1 line
Jens Axboe