ublk_drv: fix ublk device leak in case that add_disk fails
->free_disk is only called after disk is added successfully, so drop ublk device reference in case of add_disk() failure. Fixes: 6d9e6dfd ("ublk: defer disk allocation") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20220730092750.1118167-3-ming.lei@redhat.comSigned-off-by: Jens Axboe <axboe@kernel.dk>
Showing
Please register or sign in to comment