RDMA: Check attr_mask during modify_qp
[sfrench/cifs-2.6.git] / drivers / infiniband / hw / qedr / verbs.c
index 29a96ff6fc66b66e8df5a98f48d642cd852c92f6..34c07a18c2c218dfcaf2334d22c6a881d56d42c1 100644 (file)
@@ -2472,6 +2472,9 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
                 "modify qp: qp %p attr_mask=0x%x, state=%d", qp, attr_mask,
                 attr->qp_state);
 
+       if (attr_mask & ~IB_QP_ATTR_STANDARD_BITS)
+               return -EOPNOTSUPP;
+
        old_qp_state = qedr_get_ibqp_state(qp->state);
        if (attr_mask & IB_QP_STATE)
                new_qp_state = attr->qp_state;