RDMA: Check attr_mask during modify_qp
[linux-2.6-block.git] / drivers / infiniband / hw / cxgb4 / qp.c
index f20379e4e2ec2202115864c78ed621c9b484dfe3..79e69d449b074809a12c8d906eac859f42c80b36 100644 (file)
@@ -2374,6 +2374,9 @@ int c4iw_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 
        pr_debug("ib_qp %p\n", ibqp);
 
+       if (attr_mask & ~IB_QP_ATTR_STANDARD_BITS)
+               return -EOPNOTSUPP;
+
        /* iwarp does not support the RTR state */
        if ((attr_mask & IB_QP_STATE) && (attr->qp_state == IB_QPS_RTR))
                attr_mask &= ~IB_QP_STATE;
@@ -2680,6 +2683,9 @@ int c4iw_create_srq(struct ib_srq *ib_srq, struct ib_srq_init_attr *attrs,
        int ret;
        int wr_len;
 
+       if (attrs->srq_type != IB_SRQT_BASIC)
+               return -EOPNOTSUPP;
+
        pr_debug("%s ib_pd %p\n", __func__, pd);
 
        php = to_c4iw_pd(pd);