From: Roel Kluin Date: Fri, 18 Sep 2009 19:44:18 +0000 (-0700) Subject: ARM: STMP3xxx: deallocation with negative index of descriptors[] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2cc0bab8616a3d0ae1bae11f5cf16a582424aa91;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 --- diff --git a/arch/arm/plat-stmp3xxx/dma.c b/arch/arm/plat-stmp3xxx/dma.c index d2f497764dc..ef88f25fb87 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; }