aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2022-03-08 06:51:51 +0100
committerJens Axboe <[email protected]>2022-03-08 19:40:01 -0700
commitc76c46fa04c42f7d3a494c526ce5f030da36b553 (patch)
tree581a1de75343f946597745952fec4ad8c18c09d9
parentfad45c3007a18064da759b4dba35eb722bc64e97 (diff)
sd: call sd_zbc_release_disk before releasing the scsi_device reference
sd_zbc_release_disk accesses disk->device, so ensure that actually still has a valid reference. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/scsi/sd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 7479e7cb36b4..7bfebf5b2832 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3672,9 +3672,9 @@ static void scsi_disk_release(struct device *dev)
disk->private_data = NULL;
put_disk(disk);
- put_device(&sdkp->device->sdev_gendev);
sd_zbc_release_disk(sdkp);
+ put_device(&sdkp->device->sdev_gendev);
kfree(sdkp);
}