Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad1f9791e91511fcff21730e55ad8dbc375c79bb
Commit:     ad1f9791e91511fcff21730e55ad8dbc375c79bb
Parent:     dee234f48aa6b5ee6041d33c4fd59d2f1176e9a1
Author:     Krishna Kumar <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 4 09:14:57 2006 +0530
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Dec 12 11:50:20 2006 -0800

    RDMA/amso1100: Fix memory leak in c2_qp_modify()
    
    vq_req is leaked in error cases.
    
    Signed-off-by: Krishna Kumar <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 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 179d005..420c138 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,
 
        if (attr_mask & IB_QP_STATE) {
                /* Ensure the state is valid */
-               if (attr->qp_state < 0 || attr->qp_state > IB_QPS_ERR)
-                       return -EINVAL;
+               if (attr->qp_state < 0 || attr->qp_state > IB_QPS_ERR) {
+                       err = -EINVAL;
+                       goto bail0;
+               }
 
                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,
                if (attr->cur_qp_state != IB_QPS_RTR &&
                    attr->cur_qp_state != IB_QPS_RTS &&
                    attr->cur_qp_state != IB_QPS_SQD &&
-                   attr->cur_qp_state != IB_QPS_SQE)
-                       return -EINVAL;
-               else
+                   attr->cur_qp_state != IB_QPS_SQE) {
+                       err = -EINVAL;
+                       goto bail0;
+               } else
                        wr.next_qp_state =
                            cpu_to_be32(to_c2_state(attr->cur_qp_state));
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to