misc: cb710: Fix a NULL vs IS_ERR() check in probe()
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")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/misc/cb710/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/cb710/core.c +2 -2
@@ -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
Quoted 5 lines · Dan Carpenter
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")Signed-off-by Dan Carpenter <[email protected]>
Acked-by Arnd Bergmann <[email protected]>