Forgot to add the 'Signed-off-by'

This patch fixes an erroneous return in func amso_create_cq() and a memory
leak in amso_create_qp().

Signed-off-by: Pradipta Kumar Banerjee <[EMAIL PROTECTED]>

---

Index = libamso/verbs.c
============================================================================
--- verbs.org   2006-06-13 18:56:50.000000000 +0530
+++ verbs.c     2006-06-13 19:02:03.000000000 +0530
@@ -154,9 +154,8 @@ struct ibv_cq *amso_create_cq(struct ibv
        int ret;
 
        cq = malloc(sizeof *cq);
-       if (!cq) {
-               goto err;
-       }
+       if (!cq) 
+               return NULL;
 
        ret = ibv_cmd_create_cq(context, cqe, channel, comp_vector,
                                &cq->ibv_cq, &cmd.ibv_cmd, sizeof cmd,
@@ -248,14 +247,15 @@ struct ibv_qp *amso_create_qp(struct ibv
        ret = ibv_cmd_create_qp(pd, &qp->ibv_qp, attr, &cmd.ibv_cmd, sizeof cmd,
                                &resp.ibv_resp, sizeof resp);
        if (ret)
-               return NULL;
+               goto err;
 
 #if 0 /* A reminder for bypass functionality */
        qp->physaddr = resp.physaddr;
 #endif
 
        return &qp->ibv_qp;
-
+err:
+       free(qp);
 
        return NULL;
 }

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to