瀏覽代碼

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 <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>
Roel Kluin 15 年之前
父節點
當前提交
2cc0bab861
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/arm/plat-stmp3xxx/dma.c

+ 1 - 1
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,
 					stmp3xxx_dma_free_command(ch,
 								  &descriptors
 								  &descriptors
 								  [i]);
 								  [i]);
-				} while (i-- >= 0);
+				} while (i-- > 0);
 			}
 			}
 			return err;
 			return err;
 		}
 		}