diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-16 16:19:08 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-23 21:54:30 +0300 |
commit | 4a1fa41d304c7129328d4d5c7f31715b95e23b29 (patch) | |
tree | d4dc44ad63f2f1421feb50c15c2b616150af27e9 /drivers/scsi/sr.c | |
parent | a58bd7683fcb60ae24c8572f932b48bc65719b7c (diff) | |
download | linux-4a1fa41d304c7129328d4d5c7f31715b95e23b29.tar.xz |
block: pass a request_queue to __blk_alloc_disk
Pass in a request_queue and assign disk->queue in __blk_alloc_disk to
ensure struct gendisk always has a valid ->queue pointer.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210816131910.615153-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r-- | drivers/scsi/sr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 2c45b4140e67..a0df27db4d61 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -714,7 +714,8 @@ static int sr_probe(struct device *dev) kref_init(&cd->kref); - disk = __alloc_disk_node(NUMA_NO_NODE, &sr_bio_compl_lkclass); + disk = __alloc_disk_node(sdev->request_queue, NUMA_NO_NODE, + &sr_bio_compl_lkclass); if (!disk) goto fail_free; mutex_init(&cd->lock); @@ -765,7 +766,6 @@ static int sr_probe(struct device *dev) set_capacity(disk, cd->capacity); disk->private_data = &cd->driver; - disk->queue = sdev->request_queue; if (register_cdrom(disk, &cd->cdi)) goto fail_minor; |