mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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: 262d431f90
("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>
This commit is contained in:
parent
7b05bf7710
commit
3375dca0b5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user