archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <>
Subject: [PATCH 1/2] mtd_blkdevs: initialze new->rq in add_mtd_blktrans_dev
Date: Wed, 16 Jun 2021 09:15:46 +0200	[thread overview]
Message-ID: <> (raw)

Various places expect the request_queue in ->rq.  Initialize it to
avoid NULL pointer derefences.

Fixes: 6966bb921def ("mtd_blkdevs: use blk_mq_alloc_disk")
Reported-by: Marek Szyprowski <>
Signed-off-by: Christoph Hellwig <>
Tested-by: Marek Szyprowski <>
 drivers/mtd/mtd_blkdevs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 5dc4c966ea73..6ce4bc57f919 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -382,6 +382,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
 	new->disk = gd;
+	new->rq = new->disk->queue;
 	gd->private_data = new;
 	gd->major = tr->major;
 	gd->first_minor = (new->devnum) << tr->part_bits;

             reply	other threads:[~2021-06-16  7:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  7:15 Christoph Hellwig [this message]
2021-06-16  7:15 ` [PATCH 2/2] loop: fix order of cleaning up the queue and freeing the tagset Christoph Hellwig
2021-06-16 12:54 ` [PATCH 1/2] mtd_blkdevs: initialze new->rq in add_mtd_blktrans_dev 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:

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

  git send-email \ \ \ \ \ \ \

* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).