From 2cc0bab8616a3d0ae1bae11f5cf16a582424aa91 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Fri, 18 Sep 2009 12:44:18 -0700 Subject: [PATCH] ARM: STMP3xxx: deallocation with negative index of descriptors[] The last deallocation is invalid. In the last iteration, i is -1. Signed-off-by: Roel Kluin Acked-by: dmitry pervushin Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Russell King --- arch/arm/plat-stmp3xxx/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-stmp3xxx/dma.c b/arch/arm/plat-stmp3xxx/dma.c index d2f4977..ef88f25 100644 --- a/arch/arm/plat-stmp3xxx/dma.c +++ b/arch/arm/plat-stmp3xxx/dma.c @@ -264,7 +264,7 @@ int stmp3xxx_dma_make_chain(int ch, struct stmp37xx_circ_dma_chain *chain, stmp3xxx_dma_free_command(ch, &descriptors [i]); - } while (i-- >= 0); + } while (i-- > 0); } return err; } -- 2.7.4