[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9ff03528-b416-182f-6404-ff66f67087a9@amd.com>
Date: Tue, 20 Aug 2024 08:25:16 -0700
From: Lizhi Hou <lizhi.hou@....com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>, Brian Xu
<brian.xu@....com>, Raj Kumar Rampelli <raj.kumar.rampelli@....com>, "Vinod
Koul" <vkoul@...nel.org>, Michal Simek <michal.simek@....com>, Sonal Santan
<sonal.santan@....com>, Max Zhen <max.zhen@....com>,
<dmaengine@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <dan.carpenter@...aro.org>, <kernel-janitors@...r.kernel.org>,
<error27@...il.com>
Subject: Re: [PATCH] dmaengine: xilinx: xdma: Fix IS_ERR() vs NULL bug in
xdma_probe()
On 8/19/24 12:36, Harshit Mogalapalli wrote:
> devm_regmap_init_mmio() returns error pointers on error, it doesn't
> return NULL. Update the error check.
>
> Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
> ---
> This is based on static analysis with smatch, only compile tested.
> ---
> 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);
Reviewed-by: Lizhi Hou <lizhi.hou@....com>
> xdma_err(xdev, "config regmap failed: %d", ret);
> goto failed;
> }
Powered by blists - more mailing lists