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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 4728d546
...@@ -731,9 +731,11 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base) ...@@ -731,9 +731,11 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base)
mask &= 0x07; mask &= 0x07;
break; break;
case XFER_MW_DMA_0: case XFER_MW_DMA_0:
if (id->field_valid & 2)
mask = id->dma_mword & hwif->mwdma_mask; mask = id->dma_mword & hwif->mwdma_mask;
break; break;
case XFER_SW_DMA_0: case XFER_SW_DMA_0:
if (id->field_valid & 2)
mask = id->dma_1word & hwif->swdma_mask; mask = id->dma_1word & hwif->swdma_mask;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment