diff options
author | Alex Elder <elder@linaro.org> | 2018-06-26 02:58:49 +0200 |
---|---|---|
committer | Andy Gross <andy.gross@linaro.org> | 2018-09-13 23:56:58 +0200 |
commit | 06ada44a807fc5c1745d2001faba3e0b4e2e060a (patch) | |
tree | d4c2a988390f97c7663b281bb85641496e2440b1 | |
parent | soc: qcom: smem: small refactor in qcom_smem_enumerate_partitions() (diff) | |
download | linux-06ada44a807fc5c1745d2001faba3e0b4e2e060a.tar.xz linux-06ada44a807fc5c1745d2001faba3e0b4e2e060a.zip |
soc: qcom: smem: verify both host ids in partition header
The global partition is indicated by having both host values in its
table of contents entry equal SMEM_GLOBAL_HOST=0xfffe.
In qcom_smem_set_global_partition(), we check whether the header
structure at the beginning of the partition contains that host
value, but the check only verifies *one* of them. Change the check
so the partition header must have SMEM_GLOBAL_HOST for *both* its
host fields.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
-rw-r--r-- | drivers/soc/qcom/smem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index 8d2582c99808..deaac7416de7 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -770,7 +770,7 @@ static int qcom_smem_set_global_partition(struct qcom_smem *smem) return -EINVAL; } - if (host0 != SMEM_GLOBAL_HOST && host1 != SMEM_GLOBAL_HOST) { + if (host0 != SMEM_GLOBAL_HOST || host1 != SMEM_GLOBAL_HOST) { dev_err(smem->dev, "Global partition hosts are invalid\n"); return -EINVAL; } |