All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shenghui Wang <shhuiw@foxmail.com>
To: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: [PATCH] block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx
Date: Mon,  1 Apr 2019 21:40:36 +0800	[thread overview]
Message-ID: <20190401134036.8377-1-shhuiw@foxmail.com> (raw)

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

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
---
 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




             reply	other threads:[~2019-04-01 13:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 13:40 Shenghui Wang [this message]
2019-04-02  7:59 ` [PATCH] block: use blk_free_flush_queue() to free hctx->fq in blk_mq_init_hctx Ming Lei
2019-04-02 14:20 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401134036.8377-1-shhuiw@foxmail.com \
    --to=shhuiw@foxmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.