Commit 6fd98c12 authored by Subramaniam Chanderashekarapuram's avatar Subramaniam Chanderashekarapuram Committed by Ohad Ben-Cohen

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: default avatarSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
[ohad@wizery.com: reword commit log, stick with the for loop]
Signed-off-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
parent d48b97b4
...@@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i) ...@@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i)
{ {
struct rproc *rproc = rvdev->rproc; struct rproc *rproc = rvdev->rproc;
for (i--; i > 0; i--) { for (i--; i >= 0; i--) {
struct rproc_vring *rvring = &rvdev->vring[i]; struct rproc_vring *rvring = &rvdev->vring[i];
int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment