mtd_blkdevs: initialze new->rq in add_mtd_blktrans_dev
Subsystems (2)
PATCH 1/2 mtd_blkdevs: initialze new->rq in add_mtd_blktrans_dev
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 <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
Tested-by Marek Szyprowski <[email protected]>
--- drivers/mtd/mtd_blkdevs.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/mtd_blkdevs.c +1 -0
@@ -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;
Signature · 1 line
2.30.2
PATCH 2/2 loop: fix order of cleaning up the queue and freeing the tagset
We must release the queue before freeing the tagset.
Fixes 1c99502fae35 ("loop: use blk_mq_alloc_disk and blk_cleanup_disk")
Reported-by Bruno Goncalves <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/loop.c +1 -1
@@ -2172,8 +2172,8 @@ static int loop_add(struct loop_device **l, int i)static void loop_remove (struct loop_device *lo) {del_gendisk (lo->lo_disk); -blk_mq_free_tag_set (&lo->tag_set);blk_cleanup_disk (lo->lo_disk); +blk_mq_free_tag_set (&lo->tag_set);mutex_destroy (&lo->lo_mutex);kfree (lo); }
Signature · 1 line
2.30.2
Jens Axboe
maintainerQuoted 2 lines · Christoph Hellwig
Various places expect the
request_queuein ->rq. Initialize it to avoid NULL pointer derefences.
Applied 1-2, thanks.
Signature · 1 line
Jens Axboe