Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751867AbdINVZT (ORCPT ); Thu, 14 Sep 2017 17:25:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42176 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdINVZP (ORCPT ); Thu, 14 Sep 2017 17:25:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 33D2F6073A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=clew@codeaurora.org From: Chris Lew To: bjorn.andersson@linaro.org, andy.gross@linaro.org, david.brown@linaro.org Cc: aneela@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org, clew@codeaurora.org Subject: [PATCH v2 1/5] soc: qcom: smem: Use le32_to_cpu for partition size comparison Date: Thu, 14 Sep 2017 14:24:58 -0700 Message-Id: <1505424302-29147-2-git-send-email-clew@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1505424302-29147-1-git-send-email-clew@codeaurora.org> References: <1505424302-29147-1-git-send-email-clew@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 839 Lines: 28 Endianness can vary in the system, add le32_to_cpu when comparing size values from smem. Signed-off-by: Chris Lew --- Changes since v1: - New change 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 c28275be0038..db04c45d4132 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -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; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project