aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-15 18:51:46 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-15 18:51:46 -0400
commit3649c06e66ad3589374e8765ed69eda65658735c (patch)
treef1ab3e892a8c6719f5d986185b86046c2e2a25c5
parent4728d546d7137ad5350cc2e53d4748fd26f61a60 (diff)
ide: add missing validity checks for identify words 62 and 63
Check validity of identify words 62 and 63 before using them in ide_get_mode_mask(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-dma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index de33e6f88f17..ada2a3ea9430 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -731,10 +731,12 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base)
731 mask &= 0x07; 731 mask &= 0x07;
732 break; 732 break;
733 case XFER_MW_DMA_0: 733 case XFER_MW_DMA_0:
734 mask = id->dma_mword & hwif->mwdma_mask; 734 if (id->field_valid & 2)
735 mask = id->dma_mword & hwif->mwdma_mask;
735 break; 736 break;
736 case XFER_SW_DMA_0: 737 case XFER_SW_DMA_0:
737 mask = id->dma_1word & hwif->swdma_mask; 738 if (id->field_valid & 2)
739 mask = id->dma_1word & hwif->swdma_mask;
738 break; 740 break;
739 default: 741 default:
740 BUG(); 742 BUG();