summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2018-06-25 19:58:50 -0500
committerAndy Gross <andy.gross@linaro.org>2018-09-13 16:56:59 -0500
commitabc006b7a6eaf598c3987e5ae87deb7cd8221145 (patch)
tree7f07579006e017b4ddbedd016ce330cc7f5f3057 /drivers/soc
parent06ada44a807fc5c1745d2001faba3e0b4e2e060a (diff)
downloadlinux-stable-abc006b7a6eaf598c3987e5ae87deb7cd8221145.tar.gz
linux-stable-abc006b7a6eaf598c3987e5ae87deb7cd8221145.tar.bz2
linux-stable-abc006b7a6eaf598c3987e5ae87deb7cd8221145.zip
soc: qcom: smem: require order of host ids to match
In qcom_smem_enumerate_partitions(), we find all partitions that have a given local host id in either its host0 or its host1 field in the partition table entry. We then verify that the header structure at the start of each partition also contains the same two host ids as is found in the table of contents. There is no requirement that the order of the two host ids be the same in the table of contents and in the partition header. This patch changes that, requiring host0 to in the partition table entry to equal host0 in the partition header structure (and similar for the host1 values). Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/smem.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index deaac7416de7..91f814900ca1 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -848,15 +848,9 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
return -EINVAL;
}
- if (host0 != local_host && host1 != local_host) {
+ if (host0 != host0 || host1 != host1) {
dev_err(smem->dev,
- "Partition %d hosts are invalid\n", i);
- return -EINVAL;
- }
-
- if (host0 != remote_host && host1 != remote_host) {
- dev_err(smem->dev,
- "Partition %d hosts are invalid\n", i);
+ "Partition %d hosts don't match\n", i);
return -EINVAL;
}