summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2018-04-10 17:25:40 -0500
committerAndy Gross <andy.gross@linaro.org>2018-05-25 15:53:55 -0500
commit8377f8181da8dce24ace68a43e280f6a6cb2c51c (patch)
tree4b8c125613105ce49ede711a6f6112681d659059 /drivers/soc
parent04a512fea333369cc0b550f3b90df0d638e34d00 (diff)
downloadop-kernel-dev-8377f8181da8dce24ace68a43e280f6a6cb2c51c.zip
op-kernel-dev-8377f8181da8dce24ace68a43e280f6a6cb2c51c.tar.gz
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: Alex Elder <elder@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/smem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index 82f0908..0ed2630 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -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;
}
OpenPOWER on IntegriCloud