diff mbox series

pd: fix a NULL vs IS_ERR() check

Message ID 20210827100023.GB9449@kili (mailing list archive)
State New, archived
Headers show
Series pd: fix a NULL vs IS_ERR() check | expand

Commit Message

Dan Carpenter Aug. 27, 2021, 10 a.m. UTC
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(-)

Comments

Jens Axboe Aug. 27, 2021, 1:46 p.m. UTC | #1
On 8/27/21 4:00 AM, Dan Carpenter wrote:
> blk_mq_alloc_disk() returns error pointers, it doesn't return NULL
> so correct the check.

Applied, thanks.
diff mbox series

Patch

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;
 	}