From: Dan Carpenter Date: Tue, 3 Oct 2017 10:54:50 +0000 (+0300) Subject: dmaengine: stm32-dmamux: Fix a NULL vs IS_ERR() check in probe X-Git-Tag: v4.19~2206^2~5^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4219ff33b26dbaa08c728ee4ad1a3a5aae300e1a;p=platform%2Fkernel%2Flinux-rpi.git dmaengine: stm32-dmamux: Fix a NULL vs IS_ERR() check in probe devm_ioremap_resource() doesn't return NULL, it returns error pointers. Fixes: df7e762db5f6 ("dmaengine: Add STM32 DMAMUX driver") Signed-off-by: Dan Carpenter Acked-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c index 22812e7..d5db0f6 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);