The blk_mq_alloc_disk_for_queue() doesn't return error pointers, it
returns NULL on error.
Fixes: e40cb4715158 ("ublk_drv: fix request queue leak")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/YtVAgedTsQVK1oTM@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
disk = ub->ub_disk = blk_mq_alloc_disk_for_queue(ub->ub_queue,
&ublk_bio_compl_lkclass);
- if (IS_ERR(disk)) {
- err = PTR_ERR(disk);
+ if (!disk) {
+ err = -ENOMEM;
goto out_free_request_queue;
}