[ofa-general] Re: [PATCH] mad.c: Fix memory leak in switch handling and improve error handling in ib_mad_recv_done_handler

2007-08-04 Thread Michael S. Tsirkin
> Quoting Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: [PATCH] mad.c: Fix memory leak in switch handling and improve 
> error handling in ib_mad_recv_done_handler
> 
> by the way, I had to apply this by hand, because it seems gmail is
> destroying the whitespace in the patches.  I'm not sure if there's any
> way to send patches via gmail except as attachments unfortunately.

I'm using gmail smtp service and haven't seen any problems yet.
This is mosty likely the user agent's fault.

-- 
MST
___
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general


[ofa-general] Re: [PATCH] mad.c: Fix memory leak in switch handling and improve error handling

2007-07-30 Thread Hal Rosenstock
On 7/30/07, Roland Dreier <[EMAIL PROTECTED]> wrote:
> I'm having a hard time seeing what this does exactly.  It seems that
> the current code
>
>} else if (port_priv->device->node_type == 
> RDMA_NODE_IB_SWITCH) {
>/* forward case for switches */
>memcpy(response, recv, sizeof(*response));
>
> will blindly dereference response even if the allocation failed, so
> the first chunk that bails out if allocating response seems to be
> fixing this.

Yes.

> Anyway this seems like an unrelated change to the rest
> of the patch.

Do these need to be 2 separate patches ?

> I guess the leak fix is:
>
>  > -   if (!agent_send_response(&response->mad.mad,
>
>  > +   agent_send_response(&response->mad.mad,

Yes (not going to out is the leak fix).

> but now you're ignoring the return value of that function.
> Hmm... seems that the only other caller also ignores the return
> value too.  Should agent_send_response() just become a void function,
> since it doesn't seem as if there's anything useful to do with the
> return value anyway?

It could. Do you want an updated patch (or patches) ? Let me know.

-- Hal

>  - R.
>
___
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general


[ofa-general] Re: [PATCH] mad.c: Fix memory leak in switch handling and improve error handling

2007-07-30 Thread Roland Dreier
I'm having a hard time seeing what this does exactly.  It seems that
the current code

} else if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) 
{
/* forward case for switches */
memcpy(response, recv, sizeof(*response));

will blindly dereference response even if the allocation failed, so
the first chunk that bails out if allocating response seems to be
fixing this.  Anyway this seems like an unrelated change to the rest
of the patch.

I guess the leak fix is:

 > -   if (!agent_send_response(&response->mad.mad,

 > +   agent_send_response(&response->mad.mad,

but now you're ignoring the return value of that function.
Hmm... seems that the only other caller also ignores the return
value too.  Should agent_send_response() just become a void function,
since it doesn't seem as if there's anything useful to do with the
return value anyway?

 - R.
___
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general