Skip to content

Commit

Permalink
ide: add missing validity checks for identify words 62 and 63
Browse files Browse the repository at this point in the history
Check validity of identify words 62 and 63 before using them in
ide_get_mode_mask().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed May 15, 2007
1 parent 4728d54 commit 3649c06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3649c06

Please sign in to comment.