Skip to content

Commit 6fd98c1

Browse files
Subramaniam Chanderashekarapuramohadbc
authored andcommitted
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 <[email protected]> [[email protected]: reword commit log, stick with the for loop] Signed-off-by: Ohad Ben-Cohen <[email protected]>
1 parent d48b97b commit 6fd98c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/remoteproc/remoteproc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i)
354354
{
355355
struct rproc *rproc = rvdev->rproc;
356356

357-
for (i--; i > 0; i--) {
357+
for (i--; i >= 0; i--) {
358358
struct rproc_vring *rvring = &rvdev->vring[i];
359359
int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));
360360

0 commit comments

Comments
 (0)