soc: qcom: smem: Fix signedness bug in smem_dram_parse()
Subsystems (3)
PATCH 1/1 soc: qcom: smem: Fix signedness bug in smem_dram_parse()
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.
--- drivers/soc/qcom/smem_dramc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/smem_dramc.c +1 -1
@@ -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 ) {
Signature · 1 line
2.53.0
Quoted 8 lines · Dan Carpenter
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-EINVALto be handled correctly.Fixes 1d234eeafc56 ("soc: qcom: smem: Expose DDR data from SMEM")Signed-off-by Dan Carpenter <[email protected]>---
Konrad
Quoted 6 lines · Dan Carpenter
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-EINVALto be handled correctly.
Applied, thanks!
[1/1] soc: qcom: smem: Fix signedness bug in smem_dram_parse()
commit: 22f129fedb153a17d80b1d883a7c4dd2417cf38e
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>