ARM: STMP3xxx: deallocation with negative index of descriptors[]
authorRoel Kluin <roel.kluin@gmail.com>
Fri, 18 Sep 2009 19:44:18 +0000 (12:44 -0700)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 19 Sep 2009 11:14:05 +0000 (12:14 +0100)
The last deallocation is invalid. In the last iteration, i is -1.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: dmitry pervushin <dpervushin@embeddedalley.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/plat-stmp3xxx/dma.c

index d2f497764dce7afdc89ad4582b5706d139425886..ef88f25fb870edac8424254161232da10f86fac2 100644 (file)
@@ -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;
                }