|
@@ -33,6 +33,7 @@
|
|
#include <linux/stringify.h>
|
|
#include <linux/stringify.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <linux/vmalloc.h>
|
|
#include <linux/vmalloc.h>
|
|
|
|
+#include <linux/nospec.h>
|
|
|
|
|
|
#ifdef MODULE_FIRMWARE
|
|
#ifdef MODULE_FIRMWARE
|
|
MODULE_FIRMWARE("asihpi/dsp5000.bin");
|
|
MODULE_FIRMWARE("asihpi/dsp5000.bin");
|
|
@@ -186,7 +187,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|
struct hpi_adapter *pa = NULL;
|
|
struct hpi_adapter *pa = NULL;
|
|
|
|
|
|
if (hm->h.adapter_index < ARRAY_SIZE(adapters))
|
|
if (hm->h.adapter_index < ARRAY_SIZE(adapters))
|
|
- pa = &adapters[hm->h.adapter_index];
|
|
|
|
|
|
+ pa = &adapters[array_index_nospec(hm->h.adapter_index,
|
|
|
|
+ ARRAY_SIZE(adapters))];
|
|
|
|
|
|
if (!pa || !pa->adapter || !pa->adapter->type) {
|
|
if (!pa || !pa->adapter || !pa->adapter->type) {
|
|
hpi_init_response(&hr->r0, hm->h.object,
|
|
hpi_init_response(&hr->r0, hm->h.object,
|