Commit 3375dca0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Axboe

pd: fix a NULL vs IS_ERR() check

blk_mq_alloc_disk() returns error pointers, it doesn't return NULL
so correct the check.

Fixes: 262d431f ("pd: use blk_mq_alloc_disk and blk_cleanup_disk")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210827100023.GB9449@kiliSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 7b05bf77
......@@ -892,7 +892,7 @@ static void pd_probe_drive(struct pd_unit *disk)
return;
p = blk_mq_alloc_disk(&disk->tag_set, disk);
if (!p) {
if (IS_ERR(p)) {
blk_mq_free_tag_set(&disk->tag_set);
return;
}
......
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