Skip to contentSkip to conversation

sd: don't call blk_cleanup_disk in sd_probe

PATCH Applied Christoph Hellwig 2 participants 3 messages May 23, 2022 – May 24, 2022 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sd: don't call blk_cleanup_disk in sd_probe

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")
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sd.c +1 -1
index 9694e2cfaf9a6..986de990cf0f7 100644
@@ -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;
 	}
 
Signature · 1 line
2.30.2
#1 lore raw

Christoph,

Quoted 2 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering