aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libahci.c7
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 @@
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/gfp.h> 36#include <linux/gfp.h>
37#include <linux/module.h> 37#include <linux/module.h>
38#include <linux/nospec.h>
38#include <linux/blkdev.h> 39#include <linux/blkdev.h>
39#include <linux/delay.h> 40#include <linux/delay.h>
40#include <linux/interrupt.h> 41#include <linux/interrupt.h>
@@ -1146,10 +1147,12 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
1146 1147
1147 /* get the slot number from the message */ 1148 /* get the slot number from the message */
1148 pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; 1149 pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8;
1149 if (pmp < EM_MAX_SLOTS) 1150 if (pmp < EM_MAX_SLOTS) {
1151 pmp = array_index_nospec(pmp, EM_MAX_SLOTS);
1150 emp = &pp->em_priv[pmp]; 1152 emp = &pp->em_priv[pmp];
1151 else 1153 } else {
1152 return -EINVAL; 1154 return -EINVAL;
1155 }
1153 1156
1154 /* mask off the activity bits if we are in sw_activity 1157 /* mask off the activity bits if we are in sw_activity
1155 * mode, user should turn off sw_activity before setting 1158 * mode, user should turn off sw_activity before setting