[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4d4a369-427b-4fb3-9d49-84f2a0f45aff@quicinc.com>
Date: Mon, 17 Mar 2025 09:07:08 +0800
From: Jie Gan <quic_jiegan@...cinc.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach
<mike.leach@...aro.org>,
James Clark <james.clark@...aro.org>,
Alexander
Shishkin <alexander.shishkin@...ux.intel.com>,
<coresight@...ts.linaro.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH next] Coresight: Fix a NULL vs IS_ERR() bug in probe
On 3/14/2025 6:55 PM, Dan Carpenter wrote:
> The devm_platform_get_and_ioremap_resource() function doesn't
> return NULL, it returns error pointers. Update the checking to
> match.
>
> Fixes: f78d206f3d73 ("Coresight: Add Coresight TMC Control Unit driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> drivers/hwtracing/coresight/coresight-ctcu-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-ctcu-core.c b/drivers/hwtracing/coresight/coresight-ctcu-core.c
> index da35d8b4d579..c6bafc96db96 100644
> --- a/drivers/hwtracing/coresight/coresight-ctcu-core.c
> +++ b/drivers/hwtracing/coresight/coresight-ctcu-core.c
> @@ -204,8 +204,8 @@ static int ctcu_probe(struct platform_device *pdev)
> dev->platform_data = pdata;
>
> base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
> - if (!base)
> - return -ENOMEM;
> + if (IS_ERR(base))
> + return PTR_ERR(base);
>
> drvdata->apb_clk = coresight_get_enable_apb_pclk(dev);
> if (IS_ERR(drvdata->apb_clk))
Thanks for fix it. Looks good to me.
Reviewed-by: Jie Gan <quic_jiegan@...cinc.com>
Jie
Powered by blists - more mailing lists