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

Commit 8377f818 authored by Alex Elder's avatar Alex Elder Committed by Andy Gross
Browse files

soc: qcom: smem: fix off-by-one error in qcom_smem_alloc_private()



It's OK if the space for a newly-allocated uncached entry actually
touches the free cached space boundary.  It's only a problem if it
would cross it.

Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
parent 04a512fe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -375,7 +375,7 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem,

	/* Check that we don't grow into the cached region */
	alloc_size = sizeof(*hdr) + ALIGN(size, 8);
	if ((void *)hdr + alloc_size >= cached) {
	if ((void *)hdr + alloc_size > cached) {
		dev_err(smem->dev, "Out of memory\n");
		return -ENOSPC;
	}