From: Roel Kluin <redacted>
The last deallocation is invalid. In the last iteration, i is -1.
Signed-off-by: Roel Kluin <redacted>
Acked-by: dmitry pervushin <redacted>
Cc: Russell King <redacted>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/arm/plat-stmp3xxx/dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN arch/arm/plat-stmp3xxx/dma.c~stmp3xxx-deallocation-with-negative-index-of-descriptors arch/arm/plat-stmp3xxx/dma.c
--- a/arch/arm/plat-stmp3xxx/dma.c~stmp3xxx-deallocation-with-negative-index-of-descriptors
+++ a/arch/arm/plat-stmp3xxx/dma.c
@@ -264,7 +264,7 @@ int stmp3xxx_dma_make_chain(int ch, stru
stmp3xxx_dma_free_command(ch,
&descriptors
[i]);
- } while (i-- >= 0);
+ } while (i-- > 0);
}
return err;
}
_