sd_zbc_release_disk accesses disk->device, so ensure that actually still has
a valid reference.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220308055200.735835-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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);
}