Commit ad1f9791 authored by Krishna Kumar's avatar Krishna Kumar Committed by Roland Dreier

RDMA/amso1100: Fix memory leak in c2_qp_modify()

vq_req is leaked in error cases.
Signed-off-by: default avatarKrishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent dee234f4
...@@ -161,8 +161,10 @@ int c2_qp_modify(struct c2_dev *c2dev, struct c2_qp *qp, ...@@ -161,8 +161,10 @@ int c2_qp_modify(struct c2_dev *c2dev, struct c2_qp *qp,
if (attr_mask & IB_QP_STATE) { if (attr_mask & IB_QP_STATE) {
/* Ensure the state is valid */ /* Ensure the state is valid */
if (attr->qp_state < 0 || attr->qp_state > IB_QPS_ERR) if (attr->qp_state < 0 || attr->qp_state > IB_QPS_ERR) {
return -EINVAL; err = -EINVAL;
goto bail0;
}
wr.next_qp_state = cpu_to_be32(to_c2_state(attr->qp_state)); wr.next_qp_state = cpu_to_be32(to_c2_state(attr->qp_state));
...@@ -184,9 +186,10 @@ int c2_qp_modify(struct c2_dev *c2dev, struct c2_qp *qp, ...@@ -184,9 +186,10 @@ int c2_qp_modify(struct c2_dev *c2dev, struct c2_qp *qp,
if (attr->cur_qp_state != IB_QPS_RTR && if (attr->cur_qp_state != IB_QPS_RTR &&
attr->cur_qp_state != IB_QPS_RTS && attr->cur_qp_state != IB_QPS_RTS &&
attr->cur_qp_state != IB_QPS_SQD && attr->cur_qp_state != IB_QPS_SQD &&
attr->cur_qp_state != IB_QPS_SQE) attr->cur_qp_state != IB_QPS_SQE) {
return -EINVAL; err = -EINVAL;
else goto bail0;
} else
wr.next_qp_state = wr.next_qp_state =
cpu_to_be32(to_c2_state(attr->cur_qp_state)); cpu_to_be32(to_c2_state(attr->cur_qp_state));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment