Re: [PATCH next] soc: qcom: llcc-qcom: Fix NULL vs IS_ERR() bug in qcom_llcc_get_fw_config()

Mukesh Ojha <[email protected]>
Newsgroups gmane.linux.kernel.janitors,gmane.linux.ports.arm.msm,gmane.linux.kernel
Message-ID <[email protected]>
On Wed, May 20, 2026 at 09:00:30AM +0300, Dan Carpenter wrote:
> The devm_memremap() function doesn't return NULL, it returns error
> pointers.  Fix the error checking to match.
> 
> Fixes: ac23106a9b9a ("soc: qcom: llcc-qcom: get SCT descriptors from fw-populated memory")
> Signed-off-by: Dan Carpenter <[email protected]>

Duplicate patch

https://lore.kernel.org/lkml/[email protected]/

> ---
>  drivers/soc/qcom/llcc-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index dcc08f63e020..2006bfe198ea 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c
> @@ -5231,9 +5231,9 @@ static int qcom_llcc_get_fw_config(struct platform_device *pdev)
>  	}
>  
>  	slc_mem = devm_memremap(dev, res.start, resource_size(&res), MEMREMAP_WB);
> -	if (!slc_mem) {
> +	if (IS_ERR(slc_mem)) {
>  		dev_err(dev, "Failed to memremap SLC shared memory\n");
> -		return -ENOMEM;
> +		return PTR_ERR(slc_mem);
>  	}
>  
>  	ret = qcom_llcc_verify_fw_config(dev, slc_mem);
> -- 
> 2.53.0
> 

-- 
-Mukesh Ojha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.