[PATCH] block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kfree() can leak the hctx->fq->flush_rq field.

Signed-off-by: Shenghui Wang <shhuiw@xxxxxxxxxxx>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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,
 	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);
-- 
2.20.1






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux