From: Bartlomiej Zolnierkiewicz Date: Tue, 15 May 2007 22:51:46 +0000 (+0200) Subject: ide: add missing validity checks for identify words 62 and 63 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3649c06e66ad3589374e8765ed69eda65658735c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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) mask &= 0x07; break; case XFER_MW_DMA_0: - mask = id->dma_mword & hwif->mwdma_mask; + if (id->field_valid & 2) + mask = id->dma_mword & hwif->mwdma_mask; break; case XFER_SW_DMA_0: - mask = id->dma_1word & hwif->swdma_mask; + if (id->field_valid & 2) + mask = id->dma_1word & hwif->swdma_mask; break; default: BUG();