Skip to contentSkip to conversation

STMP3xxx: deallocation with negative index of descriptors[]

PATCH New akpm at linux-foundation.org 1 participant 1 message Sep 18, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

From: Roel Kluin <[email protected]>

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

---

 arch/arm/plat-stmp3xxx/dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-stmp3xxx/dma.c renamed from arch/arm/plat-stmp3xxx/dma.c~stmp3xxx-deallocation-with-negative-index-of-descriptors +1 -1
diff -puN arch/arm/plat-stmp3xxx/dma.c~stmp3xxx-deallocation-with-negative-index-of-descriptors 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;
 		}

_