diff options
author | Krishna Kumar <krkumar2@in.ibm.com> | 2006-12-03 22:44:57 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-12-12 14:50:20 -0500 |
commit | ad1f9791e91511fcff21730e55ad8dbc375c79bb (patch) | |
tree | 0871a51e84fe689f7320dc4e0710adfebed92c17 /drivers | |
parent | dee234f48aa6b5ee6041d33c4fd59d2f1176e9a1 (diff) |
RDMA/amso1100: Fix memory leak in c2_qp_modify()
vq_req is leaked in error cases.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/amso1100/c2_qp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c index 179d005ed4a5..420c1380f5c3 100644 --- a/drivers/infiniband/hw/amso1100/c2_qp.c +++ b/drivers/infiniband/hw/amso1100/c2_qp.c | |||
@@ -161,8 +161,10 @@ int c2_qp_modify(struct c2_dev *c2dev, struct c2_qp *qp, | |||
161 | 161 | ||
162 | if (attr_mask & IB_QP_STATE) { | 162 | if (attr_mask & IB_QP_STATE) { |
163 | /* Ensure the state is valid */ | 163 | /* Ensure the state is valid */ |
164 | if (attr->qp_state < 0 || attr->qp_state > IB_QPS_ERR) | 164 | if (attr->qp_state < 0 || attr->qp_state > IB_QPS_ERR) { |
165 | return -EINVAL; | 165 | err = -EINVAL; |
166 | goto bail0; | ||
167 | } | ||
166 | 168 | ||
167 | wr.next_qp_state = cpu_to_be32(to_c2_state(attr->qp_state)); | 169 | wr.next_qp_state = cpu_to_be32(to_c2_state(attr->qp_state)); |
168 | 170 | ||
@@ -184,9 +186,10 @@ int c2_qp_modify(struct c2_dev *c2dev, struct c2_qp *qp, | |||
184 | if (attr->cur_qp_state != IB_QPS_RTR && | 186 | if (attr->cur_qp_state != IB_QPS_RTR && |
185 | attr->cur_qp_state != IB_QPS_RTS && | 187 | attr->cur_qp_state != IB_QPS_RTS && |
186 | attr->cur_qp_state != IB_QPS_SQD && | 188 | attr->cur_qp_state != IB_QPS_SQD && |
187 | attr->cur_qp_state != IB_QPS_SQE) | 189 | attr->cur_qp_state != IB_QPS_SQE) { |
188 | return -EINVAL; | 190 | err = -EINVAL; |
189 | else | 191 | goto bail0; |
192 | } else | ||
190 | wr.next_qp_state = | 193 | wr.next_qp_state = |
191 | cpu_to_be32(to_c2_state(attr->cur_qp_state)); | 194 | cpu_to_be32(to_c2_state(attr->cur_qp_state)); |
192 | 195 | ||