summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-06-02 23:05:46 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2024-06-05 19:00:15 -0400
commit74552d5404e6ada5a37042d8de789784d914a080 (patch)
tree8731976444338ea7e928806df2023b3164d5731d /firmware/target/arm
parent2109d524e86b50a181923df2407f039d3d512fa5 (diff)
downloadrockbox-74552d5404e6ada5a37042d8de789784d914a080.tar.gz
rockbox-74552d5404e6ada5a37042d8de789784d914a080.zip
[coverity] RFC ata-imx31.c UDMA mode timing tables out of bounds reads
mode only goes 0-4 the original commit mixed up the index and mode bad stuff must happen but its been here for 16 years Change-Id: I7e69f4e2574029a6bc3cea76e8803d2d0357d9e2
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/imx31/ata-imx31.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/target/arm/imx31/ata-imx31.c b/firmware/target/arm/imx31/ata-imx31.c
index 3b08a38c1b..ac29cf5770 100644
--- a/firmware/target/arm/imx31/ata-imx31.c
+++ b/firmware/target/arm/imx31/ata-imx31.c
@@ -417,13 +417,13 @@ void ata_dma_set_mode(unsigned char mode)
417 else if (dmamode == 0x40 && modeidx <= ATA_MAX_UDMA) 417 else if (dmamode == 0x40 && modeidx <= ATA_MAX_UDMA)
418 { 418 {
419 /* Using Ultra DMA */ 419 /* Using Ultra DMA */
420 ata_set_udma_timings(dmamode); 420 ata_set_udma_timings(modeidx);
421 ata_dma_selected = ATA_DMA_UDMA; 421 ata_dma_selected = ATA_DMA_UDMA;
422 } 422 }
423 else if (dmamode == 0x20 && modeidx <= ATA_MAX_MWDMA) 423 else if (dmamode == 0x20 && modeidx <= ATA_MAX_MWDMA)
424 { 424 {
425 /* Using Multiword DMA */ 425 /* Using Multiword DMA */
426 ata_set_mdma_timings(dmamode); 426 ata_set_mdma_timings(modeidx);
427 ata_dma_selected = ATA_DMA_MWDMA; 427 ata_dma_selected = ATA_DMA_MWDMA;
428 } 428 }
429 else 429 else