[openib-general] [PATCH] adjust error checking in ib_post_send_mad

Sean Hefty mshefty at ichips.intel.com
Wed Nov 10 14:33:44 PST 2004


Removes unneeded check and relocates other to while loop.

- Sean

Index: core/mad.c
===================================================================
--- core/mad.c	(revision 1197)
+++ core/mad.c	(working copy)
@@ -518,14 +518,10 @@
  	if (!bad_send_wr)
  		goto error1;

-	if (!mad_agent || !send_wr )
+	if (!mad_agent || !send_wr)
  		goto error2;

-	if (send_wr->num_sge > IB_MAD_SEND_REQ_MAX_SG)
-		goto error2;
-
-	if (!mad_agent->send_handler ||
-	    (send_wr->wr.ud.timeout_ms && !mad_agent->recv_handler))
+	if (!mad_agent->send_handler)
  		goto error2;

  	mad_agent_priv = container_of(mad_agent,
@@ -543,6 +539,9 @@
  		if (send_wr->num_sge > IB_MAD_SEND_REQ_MAX_SG)
  			goto error2;

+		if (send_wr->wr.ud.timeout_ms && !mad_agent->recv_handler)
+			goto error2;
+
  		if (!send_wr->wr.ud.mad_hdr) {
  			printk(KERN_ERR PFX "MAD header must be supplied "
  			       "in WR %p\n", send_wr);




More information about the general mailing list