aboutsummaryrefslogtreecommitdiff
path: root/drivers/remoteproc/remoteproc_core.c
diff options
context:
space:
mode:
authorSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>2012-05-13 16:28:02 +0300
committerOhad Ben-Cohen <ohad@wizery.com>2012-05-13 23:15:42 +0300
commit6fd98c124c66b0b0001bc4217392d891b1ad4a02 (patch)
tree84dce535a4b106c18bc89f34d0fb146ad84cc9c8 /drivers/remoteproc/remoteproc_core.c
parentd48b97b403d23f6df0b990cee652bdf9a52337a3 (diff)
downloadlinux-6fd98c124c66b0b0001bc4217392d891b1ad4a02.tar.gz
remoteproc: fix off-by-one bug in __rproc_free_vrings
Fix a nasty off-by-one bug in __rproc_free_vrings which resulted in a memory leak and (for some platforms) failures to reload the remote processor. Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com> [ohad@wizery.com: reword commit log, stick with the for loop] Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'drivers/remoteproc/remoteproc_core.c')
-rw-r--r--drivers/remoteproc/remoteproc_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index ee15c68fb51..e756a0df366 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i)
{
struct rproc *rproc = rvdev->rproc;
- for (i--; i > 0; i--) {
+ for (i--; i >= 0; i--) {
struct rproc_vring *rvring = &rvdev->vring[i];
int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));