diff options
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 62ff091505da..8b0b93565a25 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -582,6 +582,13 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
582 | return -EINVAL; | 582 | return -EINVAL; |
583 | } | 583 | } |
584 | 584 | ||
585 | if ((attr_mask & IB_QP_PKEY_INDEX) && | ||
586 | attr->pkey_index >= dev->limits.pkey_table_len) { | ||
587 | mthca_dbg(dev, "PKey index (%u) too large. max is %d\n", | ||
588 | attr->pkey_index,dev->limits.pkey_table_len-1); | ||
589 | return -EINVAL; | ||
590 | } | ||
591 | |||
585 | mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); | 592 | mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); |
586 | if (IS_ERR(mailbox)) | 593 | if (IS_ERR(mailbox)) |
587 | return PTR_ERR(mailbox); | 594 | return PTR_ERR(mailbox); |