mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH next] soc: qcom: smem: Fix signedness bug in smem_dram_parse()
@ 2026-08-13  7:09 Dan Carpenter
  2026-08-17 10:13 ` Konrad Dybcio
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-08-13  7:09 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-kernel,
	kernel-janitors

The "ver" variable is type "enum ddr_info_version".  Enum types are
dependent on the compiler but in practical terms here, "ver" is
basically an unsigned int.  It needs to be signed for the -EINVAL
to be handled correctly.

Fixes: 1d234eeafc56 ("soc: qcom: smem: Expose DDR data from SMEM")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 drivers/soc/qcom/smem_dramc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/smem_dramc.c b/drivers/soc/qcom/smem_dramc.c
index 63ebe7f6db59..6283e9317f19 100644
--- a/drivers/soc/qcom/smem_dramc.c
+++ b/drivers/soc/qcom/smem_dramc.c
@@ -382,7 +382,7 @@ struct dentry *smem_dram_parse(struct qcom_smem *smem, struct device *dev)
 		return ERR_PTR(-ENODATA);
 
 	ver = smem_dram_infer_struct_version(actual_size);
-	if (ver < 0) {
+	if ((int)ver < 0) {
 		/* Some SoCs don't provide data that's useful for us */
 		return ERR_PTR(-ENODATA);
 	} else if (ver == INFO_UNKNOWN) {
-- 
2.53.0


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

* Re: [PATCH next] soc: qcom: smem: Fix signedness bug in smem_dram_parse()
  2026-08-13  7:09 [PATCH next] soc: qcom: smem: Fix signedness bug in smem_dram_parse() Dan Carpenter
@ 2026-08-17 10:13 ` Konrad Dybcio
  0 siblings, 0 replies; 2+ messages in thread
From: Konrad Dybcio @ 2026-08-17 10:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-kernel,
	kernel-janitors

On 8/13/26 9:09 AM, Dan Carpenter wrote:
> The "ver" variable is type "enum ddr_info_version".  Enum types are
> dependent on the compiler but in practical terms here, "ver" is
> basically an unsigned int.  It needs to be signed for the -EINVAL
> to be handled correctly.
> 
> Fixes: 1d234eeafc56 ("soc: qcom: smem: Expose DDR data from SMEM")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---

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

Konrad

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

end of thread, other threads:[~2026-08-17 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13  7:09 [PATCH next] soc: qcom: smem: Fix signedness bug in smem_dram_parse() Dan Carpenter
2026-08-17 10:13 ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®