[openib-general] [PATCH 4/13] Re-write cma_work_handler error cases

Krishna Kumar krkumar2 at in.ibm.com
Wed Oct 11 21:53:35 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
@@ -1276,14 +1276,12 @@ static void cma_work_handler(void *data)
 	int destroy = 0;
 
 	atomic_inc(&id_priv->dev_remove);
-	if (!cma_comp_exch(id_priv, work->old_state, work->new_state))
-		goto out;
-
-	if (id_priv->id.event_handler(&id_priv->id, &work->event)) {
-		cma_exch(id_priv, CMA_DESTROYING);
-		destroy = 1;
+	if (cma_comp_exch(id_priv, work->old_state, work->new_state)) {
+		if (id_priv->id.event_handler(&id_priv->id, &work->event)) {
+			cma_exch(id_priv, CMA_DESTROYING);
+			destroy = 1;
+		}
 	}
-out:
 	cma_release_remove(id_priv);
 	cma_deref_id(id_priv);
 	if (destroy)




More information about the general mailing list