Skip to content

Commit

Permalink
pd: fix a NULL vs IS_ERR() check
Browse files Browse the repository at this point in the history
blk_mq_alloc_disk() returns error pointers, it doesn't return NULL
so correct the check.

Fixes: 262d431 ("pd: use blk_mq_alloc_disk and blk_cleanup_disk")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210827100023.GB9449@kili
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Dan Carpenter authored and Jens Axboe committed Aug 27, 2021
1 parent 7b05bf7 commit 3375dca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3375dca

Please sign in to comment.