提交 c76c46fa 编写于 作者: C Christoph Hellwig 提交者: 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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBart Van Assche <bvanassche@acm.org>
Reviewed-by: NMing Lei <ming.lei@redhat.com>
Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220308055200.735835-6-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册