summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_qp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-04 16:31:54 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-04 16:31:54 -0800
commitba77df570c6710c9c19b31e0e48e4bcdf31cefe8 (patch)
tree997c210135b5578982df256dd5a0140e04d972d1 /drivers/infiniband/hw/mthca/mthca_qp.c
parent602d4a7e2f4b843d1a67375d4d7104073495b758 (diff)
parentd09e32764176b61c4afee9fd5e7fe04713bfa56f (diff)
downloadblackbird-obmc-linux-ba77df570c6710c9c19b31e0e48e4bcdf31cefe8.tar.gz
blackbird-obmc-linux-ba77df570c6710c9c19b31e0e48e4bcdf31cefe8.zip
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_qp.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c7
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 7c9afde5ace5..8852ea477c21 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -584,6 +584,13 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
return -EINVAL;
}
+ if ((attr_mask & IB_QP_PKEY_INDEX) &&
+ attr->pkey_index >= dev->limits.pkey_table_len) {
+ mthca_dbg(dev, "PKey index (%u) too large. max is %d\n",
+ attr->pkey_index,dev->limits.pkey_table_len-1);
+ return -EINVAL;
+ }
+
mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
if (IS_ERR(mailbox))
return PTR_ERR(mailbox);
OpenPOWER on IntegriCloud