Commit c76c46fa authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220308055200.735835-6-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent fad45c30
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment