Skip to contentSkip to conversation

misc: cb710: Fix a NULL vs IS_ERR() check in probe()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 29, 2025

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

PATCH 1/1 misc: cb710: Fix a NULL vs IS_ERR() check in probe()

The pcim_iomap_region() function never returns NULL, it returns error pointers. Update the checking to match.

Fixes b91c13534a63 ("misc: cb710: Replace deprecated PCI functions")
---
 drivers/misc/cb710/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/cb710/core.c +2 -2
index a1e6ba62c298..2dd212f04fed 100644
@@ -226,8 +226,8 @@ static int cb710_probe(struct pci_dev *pdev,
 	spin_lock_init(&chip->irq_lock);
 	chip->pdev = pdev;
 	chip->iobase = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
-	if (!chip->iobase)
-		return -ENOMEM;
+	if (IS_ERR(chip->iobase))
+		return PTR_ERR(chip->iobase);
 
 	pci_set_drvdata(pdev, chip);
 
Signature · 1 line
2.51.0