Skip to contentSkip to conversation

remoteproc: qcom: wcss: Fix wrong pointer passed to PTR_ERR()

PATCH Superseded 'Wei Yongjun 2 participants 2 messages Mar 25, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: qcom: wcss: Fix wrong pointer passed to PTR_ERR()

From: Wei Yongjun <[email protected]>

PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.

Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
---
 drivers/remoteproc/qcom_q6v5_wcss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/qcom_q6v5_wcss.c +1 -1
index 71ec1a451e35..eda64f86d7b0 100644
@@ -972,7 +972,7 @@ static int q6v5_wcss_init_clock(struct q6v5_wcss *wcss)
 		ret = PTR_ERR(wcss->qdsp6ss_axim_cbcr);
 		if (ret != -EPROBE_DEFER)
 			dev_err(wcss->dev, "failed to get axim cbcr clk\n");
-		return PTR_ERR(wcss->qdsp6ss_abhm_cbcr);
+		return PTR_ERR(wcss->qdsp6ss_axim_cbcr);
 	}
 
 	wcss->lcc_bcr_sleep = devm_clk_get(wcss->dev, "lcc_bcr_sleep");
#1 lore raw
Quoted 17 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned.

Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
---
 drivers/remoteproc/qcom_q6v5_wcss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/qcom_q6v5_wcss.c +0 -0
index 71ec1a451e35..eda64f86d7b0 100644

drivers/remoteproc/qcom_q6v5_wcss.c static int q6v5_wcss_init_clock(struct q6v5_wcss *wcss) · line 975

Quoted 5 lines
drivers/remoteproc/qcom_q6v5_wcss.c +1 -1
@@ -972,7 +972,7 @@ static int q6v5_wcss_init_clock(struct q6v5_wcss *wcss)
 		ret = PTR_ERR(wcss->qdsp6ss_axim_cbcr);
 		if (ret != -EPROBE_DEFER)
 			dev_err(wcss->dev, "failed to get axim cbcr clk\n");
-		return PTR_ERR(wcss->qdsp6ss_abhm_cbcr);
+		return PTR_ERR(wcss->qdsp6ss_axim_cbcr);

Just return ret;

(Don't worry about being consistent when the other returns are doing it wrong).

regards,
dan carpenter