[openib-general] [PATCH 1/13] Re-write rdma_create_qp error cases

Krishna Kumar krkumar2 at in.ibm.com
Wed Oct 11 21:53:15 PDT 2006


diff -ruNp org/drivers/infiniband/core/cma.c new/drivers/infiniband/core/cma.c
--- org/drivers/infiniband/core/cma.c	2006-10-09 16:40:04.000000000 +0530
+++ new/drivers/infiniband/core/cma.c	2006-10-09 16:52:03.000000000 +0530
@@ -389,16 +389,16 @@ int rdma_create_qp(struct rdma_cm_id *id
 		break;
 	}
 
-	if (ret)
-		goto err;
+	if (ret) {
+		ib_destroy_qp(qp);
+		goto out;
+	}
 
 	id->qp = qp;
 	id_priv->qp_num = qp->qp_num;
 	id_priv->qp_type = qp->qp_type;
 	id_priv->srq = (qp->srq != NULL);
-	return 0;
-err:
-	ib_destroy_qp(qp);
+out:
 	return ret;
 }
 EXPORT_SYMBOL(rdma_create_qp);




More information about the general mailing list