public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: stm32-dmamux: Fix a NULL vs IS_ERR() check in probe
@ 2017-10-03 10:54 Dan Carpenter
  2017-10-03 12:17 ` Pierre Yves MORDRET
  2017-10-08 10:59 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-10-03 10:54 UTC (permalink / raw)
  To: kernel-janitors

devm_ioremap_resource() doesn't return NULL, it returns error pointers.

Fixes: df7e762db5f6 ("dmaengine: Add STM32 DMAMUX driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index 22812e7a953b..d5db0f6e1ff8 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -257,8 +257,8 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	iomem = devm_ioremap_resource(&pdev->dev, res);
-	if (!iomem)
-		return -ENOMEM;
+	if (IS_ERR(iomem))
+		return PTR_ERR(iomem);
 
 	spin_lock_init(&stm32_dmamux->lock);
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-08 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 10:54 [PATCH] dmaengine: stm32-dmamux: Fix a NULL vs IS_ERR() check in probe Dan Carpenter
2017-10-03 12:17 ` Pierre Yves MORDRET
2017-10-08 10:59 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox