* [PATCH] remoteproc: fix off-by-one bug in __rproc_free_vrings
@ 2012-05-13 20:14 Ohad Ben-Cohen
0 siblings, 0 replies; only message in thread
From: Ohad Ben-Cohen @ 2012-05-13 20:14 UTC (permalink / raw)
To: linux-arm-kernel
From: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
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 at wizery.com: reword commit log, stick with the for loop]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/remoteproc/remoteproc_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index ee15c68..e756a0d 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));
--
1.7.5.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-13 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-13 20:14 [PATCH] remoteproc: fix off-by-one bug in __rproc_free_vrings Ohad Ben-Cohen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).