Skip to contentSkip to conversation

pata_cs5536.c: fix array overrun

PATCH In review Adrian Bunk 2 participants 2 messages Oct 18, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pata_cs5536.c: fix array overrun

This patch fixes an obvious array overrun spotted by the Coverity checker.

---
9101f2e2691094244bd147a05225f6c84bdf7404

drivers/ata/pata_cs5536.c +1 -1
index 53070f6..00039a1 100644
@@ -214,7 +214,7 @@ static void cs5536_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 		cs5536_read(pdev, DTC, &dtc);
 
 		dtc &= ~(IDE_DRV_MASK << dshift);
-		dtc |= mwdma_timings[mode] << dshift;
+		dtc |= mwdma_timings[mode - XFER_MW_DMA_0] << dshift;
 
 		cs5536_write(pdev, DTC, dtc);
 	}
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Adrian" == Adrian Bunk <[email protected]> writes:

Adrian> This patch fixes an obvious array overrun spotted by the Adrian> Coverity checker.

Bart already posted a patch for this.

Signature · 1 line
Martin K. Petersen      http://mkp.net/