* [PATCH next] misc: cb710: Fix a NULL vs IS_ERR() check in probe()
@ 2025-10-29 13:13 Dan Carpenter
2025-10-29 13:34 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-10-29 13:13 UTC (permalink / raw)
To: Madhur Kumar
Cc: Michał Mirosław, Arnd Bergmann, Greg Kroah-Hartman,
linux-kernel, kernel-janitors
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 <dan.carpenter@linaro.org>
---
drivers/misc/cb710/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c
index a1e6ba62c298..2dd212f04fed 100644
--- a/drivers/misc/cb710/core.c
+++ b/drivers/misc/cb710/core.c
@@ -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);
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH next] misc: cb710: Fix a NULL vs IS_ERR() check in probe()
2025-10-29 13:13 [PATCH next] misc: cb710: Fix a NULL vs IS_ERR() check in probe() Dan Carpenter
@ 2025-10-29 13:34 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2025-10-29 13:34 UTC (permalink / raw)
To: Dan Carpenter, Madhur Kumar
Cc: Michał Mirosław, Greg Kroah-Hartman, linux-kernel,
kernel-janitors
On Wed, Oct 29, 2025, at 14:13, Dan Carpenter wrote:
> 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 <dan.carpenter@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-29 13:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 13:13 [PATCH next] misc: cb710: Fix a NULL vs IS_ERR() check in probe() Dan Carpenter
2025-10-29 13:34 ` Arnd Bergmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.