diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2018-08-03 17:55:12 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-08-03 17:55:12 +0800 |
| commit | c5f5aeef9b55b362ad5a0e04e4b41cd63b208842 (patch) | |
| tree | 0ee2bb561e879db0a990d998359f6516dff3393b /drivers/ata/libahci.c | |
| parent | a4789089937941959be6c18fa53e1fc0189257fd (diff) | |
| parent | c7513c2a2714204d3588ecaa170ae628fd0d217e (diff) | |
| download | linux-c5f5aeef9b55b362ad5a0e04e4b41cd63b208842.tar.bz2 | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Merge mainline to pick up c7513c2a2714 ("crypto/arm64: aes-ce-gcm -
add missing kernel_neon_begin/end pair").
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 |