|
@@ -14,6 +14,8 @@
|
|
#include <linux/poll.h>
|
|
#include <linux/poll.h>
|
|
#include <linux/wait.h>
|
|
#include <linux/wait.h>
|
|
|
|
|
|
|
|
+#include <linux/nospec.h>
|
|
|
|
+
|
|
MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
|
|
MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
|
|
MODULE_VERSION("0.1");
|
|
MODULE_VERSION("0.1");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_LICENSE("GPL");
|
|
@@ -909,6 +911,8 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev,
|
|
default:
|
|
default:
|
|
if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id))
|
|
if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id))
|
|
return -EINVAL;
|
|
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]);
|
|
p.pff = ioread32(&pcfg->dsp_pff_inst_id[p.port - 1]);
|
|
break;
|
|
break;
|
|
}
|
|
}
|