diff mbox series

[next] firmware: qcom: scm: Fix error code in probe()

Message ID a0845467-4f83-4070-ab1e-ff7e6764609f@stanley.mountain (mailing list archive)
State New
Headers show
Series [next] firmware: qcom: scm: Fix error code in probe() | expand

Commit Message

Dan Carpenter Jan. 15, 2025, 6:52 a.m. UTC
Set the error code if devm_qcom_tzmem_pool_new() fails.  Don't return
success.

Fixes: 1e76b546e6fc ("firmware: qcom: scm: Cleanup global '__scm' on probe failures")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/firmware/qcom/qcom_scm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski Jan. 15, 2025, 8:20 a.m. UTC | #1
On 15/01/2025 07:52, Dan Carpenter wrote:
> Set the error code if devm_qcom_tzmem_pool_new() fails.  Don't return
> success.
> 
> Fixes: 1e76b546e6fc ("firmware: qcom: scm: Cleanup global '__scm' on probe failures")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Uh, one can stare at own code for hours and never see the issue.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index f0569bb9411f..fc4d67e4c4a6 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -2301,8 +2301,8 @@  static int qcom_scm_probe(struct platform_device *pdev)
 
 	__scm->mempool = devm_qcom_tzmem_pool_new(__scm->dev, &pool_config);
 	if (IS_ERR(__scm->mempool)) {
-		dev_err_probe(__scm->dev, PTR_ERR(__scm->mempool),
-			      "Failed to create the SCM memory pool\n");
+		ret = dev_err_probe(__scm->dev, PTR_ERR(__scm->mempool),
+				    "Failed to create the SCM memory pool\n");
 		goto err;
 	}