Skip to content

Commit

Permalink
remoteproc: fix off-by-one bug in __rproc_free_vrings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Subramaniam Chanderashekarapuram authored and ohadbc committed May 13, 2012
1 parent d48b97b commit 6fd98c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 6fd98c1

Please sign in to comment.