diff options
author | David S. Miller <davem@davemloft.net> | 2018-09-18 18:33:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-18 18:33:27 +0200 |
commit | e366fa435032db1ce1538a2c029714666985dd48 (patch) | |
tree | d08bab02ba212339e4cfc0f2e3666435dd795b90 /drivers/pci/switch/switchtec.c | |
parent | net: mdio: remove duplicated include from mdio_bus.c (diff) | |
parent | Merge gitolite.kernel.org:/pub/scm/linux/kernel/git/davem/net (diff) | |
download | linux-e366fa435032db1ce1538a2c029714666985dd48.tar.xz linux-e366fa435032db1ce1538a2c029714666985dd48.zip |
Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net
Two new tls tests added in parallel in both net and net-next.
Used Stephen Rothwell's linux-next resolution.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/pci/switch/switchtec.c')
-rw-r--r-- | drivers/pci/switch/switchtec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 9940cc70f38b..54a8b30dda38 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -14,6 +14,8 @@ #include <linux/poll.h> #include <linux/wait.h> +#include <linux/nospec.h> + MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver"); MODULE_VERSION("0.1"); MODULE_LICENSE("GPL"); @@ -909,6 +911,8 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev, default: if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id)) return -EINVAL; + p.port = array_index_nospec(p.port, + ARRAY_SIZE(pcfg->dsp_pff_inst_id) + 1); p.pff = ioread32(&pcfg->dsp_pff_inst_id[p.port - 1]); break; } |