aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index d786ef443614..ea45fa400fab 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -621,6 +621,12 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
621 return -EINVAL; 621 return -EINVAL;
622 } 622 }
623 623
624 if ((attr_mask & IB_QP_PORT) &&
625 (attr->port_num == 0 || attr->port_num > dev->limits.num_ports)) {
626 mthca_dbg(dev, "Port number (%u) is invalid\n", attr->port_num);
627 return -EINVAL;
628 }
629
624 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && 630 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC &&
625 attr->max_rd_atomic > dev->limits.max_qp_init_rdma) { 631 attr->max_rd_atomic > dev->limits.max_qp_init_rdma) {
626 mthca_dbg(dev, "Max rdma_atomic as initiator %u too large (max is %d)\n", 632 mthca_dbg(dev, "Max rdma_atomic as initiator %u too large (max is %d)\n",