Skip to contentSkip to conversation

pd: fix a NULL vs IS_ERR() check

PATCH Applied Dan Carpenter 2 participants 2 messages Aug 27, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 262d431f9000 ("pd: use blk_mq_alloc_disk and blk_cleanup_disk")
---
 drivers/block/paride/pd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/paride/pd.c +1 -1
index 9b3298926356..675327df6aff 100644
@@ -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;
 	}
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Dan Carpenter

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

Applied, thanks.

Signature · 1 line
Jens Axboe