linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: qcom: scm: preserve assign_mem() error return value
@ 2025-08-07 12:44 Mukesh Ojha
  2025-08-07 12:53 ` Konrad Dybcio
  2025-08-11 18:41 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Mukesh Ojha @ 2025-08-07 12:44 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio; +Cc: linux-arm-msm, linux-kernel, Mukesh Ojha

When qcom_scm_assign_mem() fails, the error value is currently being
overwritten after it is logged, resulting in the loss of the original
error code. Fix this by retaining and returning the original error value
as intended.

Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
 drivers/firmware/qcom/qcom_scm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 26cd0458aacd..5243d5abbbe9 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -1119,7 +1119,7 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
 	if (ret) {
 		dev_err(__scm->dev,
 			"Assign memory protection call failed %d\n", ret);
-		return -EINVAL;
+		return ret;
 	}
 
 	*srcvm = next_vm;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: qcom: scm: preserve assign_mem() error return value
  2025-08-07 12:44 [PATCH] firmware: qcom: scm: preserve assign_mem() error return value Mukesh Ojha
@ 2025-08-07 12:53 ` Konrad Dybcio
  2025-08-11 18:41 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2025-08-07 12:53 UTC (permalink / raw)
  To: Mukesh Ojha, Bjorn Andersson, Konrad Dybcio; +Cc: linux-arm-msm, linux-kernel

On 8/7/25 2:44 PM, Mukesh Ojha wrote:
> When qcom_scm_assign_mem() fails, the error value is currently being
> overwritten after it is logged, resulting in the loss of the original
> error code. Fix this by retaining and returning the original error value
> as intended.
> 
> Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: qcom: scm: preserve assign_mem() error return value
  2025-08-07 12:44 [PATCH] firmware: qcom: scm: preserve assign_mem() error return value Mukesh Ojha
  2025-08-07 12:53 ` Konrad Dybcio
@ 2025-08-11 18:41 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2025-08-11 18:41 UTC (permalink / raw)
  To: Konrad Dybcio, Mukesh Ojha; +Cc: linux-arm-msm, linux-kernel


On Thu, 07 Aug 2025 18:14:51 +0530, Mukesh Ojha wrote:
> When qcom_scm_assign_mem() fails, the error value is currently being
> overwritten after it is logged, resulting in the loss of the original
> error code. Fix this by retaining and returning the original error value
> as intended.
> 
> 

Applied, thanks!

[1/1] firmware: qcom: scm: preserve assign_mem() error return value
      commit: 121fcf3c871181edce0708a49d2397cedd6ad21f

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-11 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 12:44 [PATCH] firmware: qcom: scm: preserve assign_mem() error return value Mukesh Ojha
2025-08-07 12:53 ` Konrad Dybcio
2025-08-11 18:41 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).