diff options
Diffstat (limited to 'drivers/infiniband/hw/hfi1/verbs.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/verbs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index c4b243f50c76..646f61545ed6 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <linux/mm.h> | 54 | #include <linux/mm.h> |
55 | #include <linux/vmalloc.h> | 55 | #include <linux/vmalloc.h> |
56 | #include <rdma/opa_addr.h> | 56 | #include <rdma/opa_addr.h> |
57 | #include <linux/nospec.h> | ||
57 | 58 | ||
58 | #include "hfi.h" | 59 | #include "hfi.h" |
59 | #include "common.h" | 60 | #include "common.h" |
@@ -1536,6 +1537,7 @@ static int hfi1_check_ah(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr) | |||
1536 | sl = rdma_ah_get_sl(ah_attr); | 1537 | sl = rdma_ah_get_sl(ah_attr); |
1537 | if (sl >= ARRAY_SIZE(ibp->sl_to_sc)) | 1538 | if (sl >= ARRAY_SIZE(ibp->sl_to_sc)) |
1538 | return -EINVAL; | 1539 | return -EINVAL; |
1540 | sl = array_index_nospec(sl, ARRAY_SIZE(ibp->sl_to_sc)); | ||
1539 | 1541 | ||
1540 | sc5 = ibp->sl_to_sc[sl]; | 1542 | sc5 = ibp->sl_to_sc[sl]; |
1541 | if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf) | 1543 | if (sc_to_vlt(dd, sc5) > num_vls && sc_to_vlt(dd, sc5) != 0xf) |