aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorIliyan Malchev <malchev@google.com>2011-09-13 23:06:29 -0700
committerIliyan Malchev <malchev@google.com>2011-09-13 23:31:14 -0700
commitd0938b1c7518784ddd33372bcb5bc18ea8f9ce08 (patch)
treea5ad9e7b37f4efc2250f2b8c20e3c1c0c8118892 /drivers/remoteproc
parent60cfd67b8811999b37962e439584f97f7a9e542c (diff)
downloadkernel_samsung_tuna-d0938b1c7518784ddd33372bcb5bc18ea8f9ce08.zip
kernel_samsung_tuna-d0938b1c7518784ddd33372bcb5bc18ea8f9ce08.tar.gz
kernel_samsung_tuna-d0938b1c7518784ddd33372bcb5bc18ea8f9ce08.tar.bz2
remoteproc: fix section-size check
Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c
index 2e9a6e0..96b855c 100644
--- a/drivers/remoteproc/remoteproc.c
+++ b/drivers/remoteproc/remoteproc.c
@@ -374,13 +374,9 @@ static int rproc_check_poolmem(struct rproc *rproc, u32 size, phys_addr_t pa)
pr_warn("invalid pool\n");
return -EINVAL;
}
- if (pool->st_size < size) {
- pr_warn("section size bigger than carveout memory\n");
- return -ENOSPC;
- }
- if ((pa < pool->st_base) ||
- ((pa + size) > (pool->st_base + pool->st_size))) {
- pr_warn("section lies outside the remoteproc carveout\n");
+
+ if (pa < pool->st_base || pa + size > pool->st_base + pool->st_size) {
+ pr_warn("section size does not fit within carveout memory\n");
return -ENOSPC;
}