* [PATCH] soc: qcom: smem: Fix endian-unaware access of num_entries
@ 2025-07-26 23:56 Jens Reidel
2025-08-12 4:03 ` Bjorn Andersson
0 siblings, 1 reply; 2+ messages in thread
From: Jens Reidel @ 2025-07-26 23:56 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio
Cc: linux-arm-msm, linux-kernel, linux, ~postmarketos/upstreaming,
Jens Reidel
Add a missing le32_to_cpu when accessing num_entries, which is always a
little endian integer.
Fixes booting on Xiaomi Mi 9T (xiaomi-davinci) in big endian.
Signed-off-by: Jens Reidel <adrian@mainlining.org>
---
drivers/soc/qcom/smem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index cf425930539e..c4c45f15dca4 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -898,7 +898,7 @@ static u32 qcom_smem_get_item_count(struct qcom_smem *smem)
if (IS_ERR_OR_NULL(ptable))
return SMEM_ITEM_COUNT;
- info = (struct smem_info *)&ptable->entry[ptable->num_entries];
+ info = (struct smem_info *)&ptable->entry[le32_to_cpu(ptable->num_entries)];
if (memcmp(info->magic, SMEM_INFO_MAGIC, sizeof(info->magic)))
return SMEM_ITEM_COUNT;
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] soc: qcom: smem: Fix endian-unaware access of num_entries
2025-07-26 23:56 [PATCH] soc: qcom: smem: Fix endian-unaware access of num_entries Jens Reidel
@ 2025-08-12 4:03 ` Bjorn Andersson
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2025-08-12 4:03 UTC (permalink / raw)
To: Konrad Dybcio, Jens Reidel
Cc: linux-arm-msm, linux-kernel, linux, ~postmarketos/upstreaming
On Sun, 27 Jul 2025 01:56:46 +0200, Jens Reidel wrote:
> Add a missing le32_to_cpu when accessing num_entries, which is always a
> little endian integer.
>
> Fixes booting on Xiaomi Mi 9T (xiaomi-davinci) in big endian.
>
>
Applied, thanks!
[1/1] soc: qcom: smem: Fix endian-unaware access of num_entries
commit: 19e7aa0e9e46d0ad111a4af55b3d681b6ad945e0
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-12 4:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-26 23:56 [PATCH] soc: qcom: smem: Fix endian-unaware access of num_entries Jens Reidel
2025-08-12 4:03 ` 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).