Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06ada44a authored by Alex Elder's avatar Alex Elder Committed by Andy Gross
Browse files

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
parent eb68cf09
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}