diff mbox series

sd: don't call blk_cleanup_disk in sd_probe

Message ID 20220523083813.227935-1-hch@lst.de
State New
Headers show
Series sd: don't call blk_cleanup_disk in sd_probe | expand

Commit Message

Christoph Hellwig May 23, 2022, 8:38 a.m. UTC
In SCSI the midlayer has ownership of the request_queue, so on probe
failure we must only put the gendisk, but leave the request_queue alone.

Fixes: 03252259e18e ("scsi: sd: Clean up gendisk if device_add_disk() failed")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen May 24, 2022, 3:16 a.m. UTC | #1
Christoph,

> In SCSI the midlayer has ownership of the request_queue, so on probe
> failure we must only put the gendisk, but leave the request_queue alone.

Applied to 5.19/scsi-staging, thanks!
Martin K. Petersen May 24, 2022, 6:11 p.m. UTC | #2
On Mon, 23 May 2022 10:38:13 +0200, Christoph Hellwig wrote:

> In SCSI the midlayer has ownership of the request_queue, so on probe
> failure we must only put the gendisk, but leave the request_queue alone.
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] sd: don't call blk_cleanup_disk in sd_probe
      https://git.kernel.org/mkp/scsi/c/7274ce0558ad
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9694e2cfaf9a6..986de990cf0f7 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3473,7 +3473,7 @@  static int sd_probe(struct device *dev)
 	error = device_add_disk(dev, gd, NULL);
 	if (error) {
 		put_device(&sdkp->disk_dev);
-		blk_cleanup_disk(gd);
+		put_disk(gd);
 		goto out;
 	}