Commit:     32a70a817acbb96fcfcc7543932222467c771207
Parent:     8d4fbcfbe0a4bfc73e7f0297c59ae514e1f1436f
Author:     Jordan Crouse <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 1 23:46:42 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed Aug 1 23:46:42 2007 +0200

    ide: Fix an overrun found in the CS5535 IDE driver
    As found by the Coverity checker, and reported by Adrian Bunk, this
    fixes a overrun error in the CS5535 IDE driver.  Somebody got a little
    excited with the if() statement - the CS5535 only supports UDMA 0-4.
    Not a bug per se since the upper layer will never feed this function
    with speed > XFER_UDMA_4 (thanks to ->ultra_mask being set to 0x1f).
    Worth fixing anyway.
    Signed-off-by: Jordan Crouse <[EMAIL PROTECTED]>
    Cc: Adrian Bunk <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
 drivers/ide/pci/cs5535.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index ce44e38..9bd526d 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -116,7 +116,7 @@ static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
                reg &= 0x80000000UL;  /* Preserve the PIO format bit */
-               if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_7)
+               if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_4)
                        reg |= cs5535_udma_timings[speed - XFER_UDMA_0];
                else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2)
                        reg |= cs5535_mwdma_timings[speed - XFER_MW_DMA_0];
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to