soc: qcom: smem: Use le32_to_cpu for comparison
authorChris Lew <clew@codeaurora.org>
Wed, 11 Oct 2017 21:29:06 +0000 (14:29 -0700)
committerAndy Gross <andy.gross@linaro.org>
Thu, 12 Oct 2017 04:48:27 +0000 (23:48 -0500)
Endianness can vary in the system, add le32_to_cpu when comparing
partition sizes from smem.

Signed-off-by: Chris Lew <clew@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
drivers/soc/qcom/smem.c

index c28275b..db04c45 100644 (file)
@@ -698,7 +698,7 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
                        return -EINVAL;
                }
 
-               if (header->size != entry->size) {
+               if (le32_to_cpu(header->size) != le32_to_cpu(entry->size)) {
                        dev_err(smem->dev,
                                "Partition %d has invalid size\n", i);
                        return -EINVAL;