aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index dce65651d858..ad8e2c64c867 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -870,7 +870,11 @@ static unsigned int ata_id_xfermask(const u16 *id)
870 * the PIO timing number for the maximum. Turn it into 870 * the PIO timing number for the maximum. Turn it into
871 * a mask. 871 * a mask.
872 */ 872 */
873 pio_mask = (2 << (id[ATA_ID_OLD_PIO_MODES] & 0xFF)) - 1 ; 873 u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF;
874 if (mode < 5) /* Valid PIO range */
875 pio_mask = (2 << mode) - 1;
876 else
877 pio_mask = 1;
874 878
875 /* But wait.. there's more. Design your standards by 879 /* But wait.. there's more. Design your standards by
876 * committee and you too can get a free iordy field to 880 * committee and you too can get a free iordy field to