summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>2012-05-13 15:28:02 +0200
committerOhad Ben-Cohen <ohad@wizery.com>2012-05-13 22:15:42 +0200
commit6fd98c124c66b0b0001bc4217392d891b1ad4a02 (patch)
tree84dce535a4b106c18bc89f34d0fb146ad84cc9c8
parentLinux 3.4-rc6 (diff)
downloadlinux-6fd98c124c66b0b0001bc4217392d891b1ad4a02.tar.xz
linux-6fd98c124c66b0b0001bc4217392d891b1ad4a02.zip
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>
-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 ee15c68fb519..e756a0df3664 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));