diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2018-07-19 23:11:52 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2018-07-19 23:11:52 +0200 |
| commit | 73ab603f44149ff48889d5109ea9ab64bf38cc69 (patch) | |
| tree | 9550d8fb31ddf6dffedf1f602ed44769e529c1d3 /drivers/ata/libahci.c | |
| parent | 41afb1dfad4d6af0c716746f6a15f3230482955c (diff) | |
| parent | fb7d1bcf1602b46f37ada72178516c01a250e434 (diff) | |
| download | linux-73ab603f44149ff48889d5109ea9ab64bf38cc69.tar.gz linux-73ab603f44149ff48889d5109ea9ab64bf38cc69.tar.bz2 linux-73ab603f44149ff48889d5109ea9ab64bf38cc69.zip | |
Merge branch 'linus' into x86/timers
Pick up upstream changes to avoid conflicts
Diffstat (limited to 'drivers/ata/libahci.c')
| -rw-r--r-- | drivers/ata/libahci.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 965842a08743..09620c2ffa0f 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -35,6 +35,7 @@ #include <linux/kernel.h> #include <linux/gfp.h> #include <linux/module.h> +#include <linux/nospec.h> #include <linux/blkdev.h> #include <linux/delay.h> #include <linux/interrupt.h> @@ -1146,10 +1147,12 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, /* get the slot number from the message */ pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; - if (pmp < EM_MAX_SLOTS) + if (pmp < EM_MAX_SLOTS) { + pmp = array_index_nospec(pmp, EM_MAX_SLOTS); emp = &pp->em_priv[pmp]; - else + } else { return -EINVAL; + } /* mask off the activity bits if we are in sw_activity * mode, user should turn off sw_activity before setting |
