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

Sean Hefty mshefty at ichips.intel.com
Tue Nov 9 09:11:39 PST 2004


Hal Rosenstock wrote:

> mad: In ib_mad_recv_done_handler, don't dispatch additional error cases
> +		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;
>  			}

			goto out;

I guess I was wondering if it was okay to move "goto out" to here, and 
always skip dispatching if process_mad returned success.  I think 
dispatching in the failure case makes sense.

>  		} else




More information about the general mailing list