* [PATCH -next] dmaengine: xilinx: xdma: Fix NULL vs IS_ERR() bug
@ 2024-08-20 13:28 Yue Haibing
2024-08-20 15:29 ` Lizhi Hou
0 siblings, 1 reply; 2+ messages in thread
From: Yue Haibing @ 2024-08-20 13:28 UTC (permalink / raw)
To: lizhi.hou, brian.xu, raj.kumar.rampelli, vkoul, michal.simek,
sonal.santan, max.zhen
Cc: dmaengine, linux-arm-kernel, linux-kernel, yuehaibing
devm_regmap_init_mmio() never returns NULL pointer, it will
return ERR_PTR() when it fails, so check it with IS_ERR().
Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
drivers/dma/xilinx/xdma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index 718842fdaf98..44fae351f0a0 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -1240,7 +1240,8 @@ static int xdma_probe(struct platform_device *pdev)
xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
&xdma_regmap_config);
- if (!xdev->rmap) {
+ if (IS_ERR(xdev->rmap)) {
+ ret = PTR_ERR(xdev->rmap);
xdma_err(xdev, "config regmap failed: %d", ret);
goto failed;
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH -next] dmaengine: xilinx: xdma: Fix NULL vs IS_ERR() bug
2024-08-20 13:28 [PATCH -next] dmaengine: xilinx: xdma: Fix NULL vs IS_ERR() bug Yue Haibing
@ 2024-08-20 15:29 ` Lizhi Hou
0 siblings, 0 replies; 2+ messages in thread
From: Lizhi Hou @ 2024-08-20 15:29 UTC (permalink / raw)
To: Yue Haibing, brian.xu, raj.kumar.rampelli, vkoul, michal.simek,
sonal.santan, max.zhen
Cc: dmaengine, linux-arm-kernel, linux-kernel
Please see:
https://lore.kernel.org/dmaengine/20240819193641.600176-1-harshit.m.mogalapalli@oracle.com/
Thanks,
Lizhi
On 8/20/24 06:28, Yue Haibing wrote:
> devm_regmap_init_mmio() never returns NULL pointer, it will
> return ERR_PTR() when it fails, so check it with IS_ERR().
>
> Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
> drivers/dma/xilinx/xdma.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
> index 718842fdaf98..44fae351f0a0 100644
> --- a/drivers/dma/xilinx/xdma.c
> +++ b/drivers/dma/xilinx/xdma.c
> @@ -1240,7 +1240,8 @@ static int xdma_probe(struct platform_device *pdev)
>
> xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
> &xdma_regmap_config);
> - if (!xdev->rmap) {
> + if (IS_ERR(xdev->rmap)) {
> + ret = PTR_ERR(xdev->rmap);
> xdma_err(xdev, "config regmap failed: %d", ret);
> goto failed;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-20 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-20 13:28 [PATCH -next] dmaengine: xilinx: xdma: Fix NULL vs IS_ERR() bug Yue Haibing
2024-08-20 15:29 ` Lizhi Hou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®