* [PATCH] pd: fix a NULL vs IS_ERR() check
@ 2021-08-27 10:00 Dan Carpenter
2021-08-27 13:46 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-27 10:00 UTC (permalink / raw)
To: Tim Waugh, Christoph Hellwig
Cc: Jens Axboe, Chaitanya Kulkarni, linux-block, kernel-janitors
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/block/paride/pd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 9b3298926356..675327df6aff 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -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;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-27 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 10:00 [PATCH] pd: fix a NULL vs IS_ERR() check Dan Carpenter
2021-08-27 13:46 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).