[openib-general] [PATCH] mad: In ib_mad_recv_done_handler, don't dispatch additional error cases

Hal Rosenstock halr at voltaire.com
Tue Nov 9 06:01:37 PST 2004


mad: In ib_mad_recv_done_handler, don't dispatch additional error cases

Index: mad.c
===================================================================
--- mad.c	(revision 1180)
+++ mad.c	(working copy)
@@ -1138,26 +1138,27 @@
 						     wc->slid,
 						     recv->header.recv_buf.mad,
 						     response);
-		if ((ret & IB_MAD_RESULT_SUCCESS) &&
-		    (ret & IB_MAD_RESULT_REPLY)) {
-			if (response->mad_hdr.mgmt_class ==
-			    IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
-				if (!smi_handle_dr_smp_recv(
-					(struct ib_smp *)response,
-					port_priv->device->node_type,
-					port_priv->port_num,
-					port_priv->device->phys_port_cnt)) {
+		if (ret & IB_MAD_RESULT_SUCCESS) {
+			if (ret & IB_MAD_RESULT_REPLY) {
+				if (response->mad_hdr.mgmt_class ==
+				    IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
+					if (!smi_handle_dr_smp_recv(
+					    (struct ib_smp *)response,
+					    port_priv->device->node_type,
+					    port_priv->port_num,
+					    port_priv->device->phys_port_cnt)) {
+						kfree(response);
+						goto out;
+					}
+				}
+				/* Send response */
+				grh = (void *)recv->header.recv_buf.mad -
+				      sizeof(struct ib_grh);
+				if (agent_send(response, grh, wc,
+					       port_priv->device,
+					       port_priv->port_num)) {
 					kfree(response);
-					goto out;
 				}
-			}
-			/* Send response */
-			grh = (void *)recv->header.recv_buf.mad -
-			      sizeof(struct ib_grh);
-			if (agent_send(response, grh, wc,
-				       port_priv->device,
-				       port_priv->port_num)) {
-				kfree(response);
 				goto out;
 			}
 		} else






More information about the general mailing list