From 74552d5404e6ada5a37042d8de789784d914a080 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 2 Jun 2024 23:05:46 -0400 Subject: [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 --- firmware/target/arm/imx31/ata-imx31.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/target/arm/imx31/ata-imx31.c') 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) else if (dmamode == 0x40 && modeidx <= ATA_MAX_UDMA) { /* Using Ultra DMA */ - ata_set_udma_timings(dmamode); + ata_set_udma_timings(modeidx); ata_dma_selected = ATA_DMA_UDMA; } else if (dmamode == 0x20 && modeidx <= ATA_MAX_MWDMA) { /* Using Multiword DMA */ - ata_set_mdma_timings(dmamode); + ata_set_mdma_timings(modeidx); ata_dma_selected = ATA_DMA_MWDMA; } else -- cgit v1.2.3