dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Subramaniam Chanderashekarapuram 2012-05-13 16:28:02 +03:00 committed by Ohad Ben-Cohen
parent d48b97b403
commit 6fd98c124c
1 changed files with 1 additions and 1 deletions

View File

@ -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));