Title: [7156] trunk/arch/blackfin/kernel/bfin_dma_5xx.c: Blackfin arch: Read buffer overflow
Revision
7156
Author
vapier
Date
2009-08-11 19:54:56 -0400 (Tue, 11 Aug 2009)

Log Message

Blackfin arch: Read buffer overflow

From: Roel Kluin <[email protected]>

Check whether index is within bounds before testing the element.

Modified Paths

Diff

Modified: trunk/arch/blackfin/kernel/bfin_dma_5xx.c (7155 => 7156)


--- trunk/arch/blackfin/kernel/bfin_dma_5xx.c	2009-08-11 21:28:53 UTC (rev 7155)
+++ trunk/arch/blackfin/kernel/bfin_dma_5xx.c	2009-08-11 23:54:56 UTC (rev 7156)
@@ -147,8 +147,8 @@
 
 int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
 {
-	BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
-	       && channel < MAX_DMA_CHANNELS));
+	BUG_ON(channel >= MAX_DMA_CHANNELS ||
+			dma_ch[channel].chan_status == DMA_CHANNEL_FREE);
 
 	if (callback != NULL) {
 		int ret;
@@ -182,8 +182,8 @@
 void free_dma(unsigned int channel)
 {
 	pr_debug("freedma() : BEGIN \n");
-	BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
-	       && channel < MAX_DMA_CHANNELS));
+	BUG_ON(channel >= MAX_DMA_CHANNELS ||
+			dma_ch[channel].chan_status == DMA_CHANNEL_FREE);
 
 	/* Halt the DMA */
 	disable_dma(channel);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to