diff mbox series

[-next] remoteproc: qcom: wcss: Fix wrong pointer passed to PTR_ERR()

Message ID 20210325030857.3978824-1-weiyongjun1@huawei.com (mailing list archive)
State Superseded
Headers show
Series [-next] remoteproc: qcom: wcss: Fix wrong pointer passed to PTR_ERR() | expand

Commit Message

Wei Yongjun March 25, 2021, 3:08 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/remoteproc/qcom_q6v5_wcss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Carpenter March 25, 2021, 7:27 a.m. UTC | #1
On Thu, Mar 25, 2021 at 03:08:57AM +0000, 'Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> 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")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/remoteproc/qcom_q6v5_wcss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c
> index 71ec1a451e35..eda64f86d7b0 100644
> --- a/drivers/remoteproc/qcom_q6v5_wcss.c
> +++ b/drivers/remoteproc/qcom_q6v5_wcss.c
> @@ -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
diff mbox series

Patch

diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c
index 71ec1a451e35..eda64f86d7b0 100644
--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -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");