[patch 2/3] STMP3xxx: deallocation with negative index of descriptors[]

akpm at linux-foundation.org akpm at linux-foundation.org
Fri Sep 18 15:44:18 EDT 2009


From: Roel Kluin <roel.kluin at gmail.com>

The last deallocation is invalid. In the last iteration, i is -1.

Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
Acked-by: dmitry pervushin <dpervushin at embeddedalley.com>
Cc: Russell King <rmk at arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm at 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;
 		}
_



More information about the linux-arm-kernel mailing list