* [PATCH] soc: qcom: llcc-qcom: Fix error check for devm_memremap()
@ 2026-05-19 2:38 Chen Ni
2026-05-19 8:16 ` Konrad Dybcio
2026-05-19 9:40 ` Markus Elfring
0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2026-05-19 2:38 UTC (permalink / raw)
To: andersson, konradybcio
Cc: francisco.ruiz, linux-arm-msm, linux-kernel, Chen Ni
The devm_memremap() function returns an error pointer on failure, not
NULL. Fix the check to use IS_ERR() and return PTR_ERR() to correctly
handle allocation failures.
Fixes: ac23106a9b9a ("soc: qcom: llcc-qcom: get SCT descriptors from fw-populated memory")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
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.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] soc: qcom: llcc-qcom: Fix error check for devm_memremap()
2026-05-19 2:38 [PATCH] soc: qcom: llcc-qcom: Fix error check for devm_memremap() Chen Ni
@ 2026-05-19 8:16 ` Konrad Dybcio
2026-05-19 9:40 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2026-05-19 8:16 UTC (permalink / raw)
To: Chen Ni, andersson, konradybcio
Cc: francisco.ruiz, linux-arm-msm, linux-kernel
On 5/19/26 4:38 AM, Chen Ni wrote:
> The devm_memremap() function returns an error pointer on failure, not
> NULL. Fix the check to use IS_ERR() and return PTR_ERR() to correctly
> handle allocation failures.
>
> Fixes: ac23106a9b9a ("soc: qcom: llcc-qcom: get SCT descriptors from fw-populated memory")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] soc: qcom: llcc-qcom: Fix error check for devm_memremap()
2026-05-19 2:38 [PATCH] soc: qcom: llcc-qcom: Fix error check for devm_memremap() Chen Ni
2026-05-19 8:16 ` Konrad Dybcio
@ 2026-05-19 9:40 ` Markus Elfring
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2026-05-19 9:40 UTC (permalink / raw)
To: Chen Ni, linux-arm-msm, Bjorn Andersson, Konrad Dybcio
Cc: LKML, Francisco Munoz Ruiz
> The devm_memremap() function returns an error pointer on failure, not
> NULL. Fix the check to use IS_ERR() and return PTR_ERR() to correctly
> handle allocation failures.
Would a summary phrase like “Fix error handling in qcom_llcc_get_fw_config()”
be more appropriate?
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-19 9:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-19 2:38 [PATCH] soc: qcom: llcc-qcom: Fix error check for devm_memremap() Chen Ni
2026-05-19 8:16 ` Konrad Dybcio
2026-05-19 9:40 ` Markus Elfring
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®