diff options
author | Hal Rosenstock <hal.rosenstock@gmail.com> | 2007-08-03 10:45:17 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-08-03 10:45:17 -0700 |
commit | 86dfbecdea733a6e940b958e94a85af45b89a0b9 (patch) | |
tree | 03ded21cc97e03cd4523b55cc13dd31a41fd2f67 | |
parent | 445d68070c9c02acdda38e6d69bd43096f521035 (diff) | |
download | blackbird-op-linux-86dfbecdea733a6e940b958e94a85af45b89a0b9.tar.gz blackbird-op-linux-86dfbecdea733a6e940b958e94a85af45b89a0b9.zip |
IB/mad: Fix memory leak in switch handling in ib_mad_recv_done_handler()
If agent_send_response() returns an error, we shouldn't do anything
differently than if it succeeds; setting response to NULL just means
that the response buffer gets leaked.
Signed-off-by: Suresh Shelvapille <suri@baymicrosystems.com>
Signed-off-by: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/core/mad.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 969785762052..6f4287716ab1 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -1916,12 +1916,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, response->header.recv_wc.recv_buf.mad = &response->mad.mad; response->header.recv_wc.recv_buf.grh = &response->grh; - if (!agent_send_response(&response->mad.mad, - &response->grh, wc, - port_priv->device, - smi_get_fwd_port(&recv->mad.smp), - qp_info->qp->qp_num)) - response = NULL; + agent_send_response(&response->mad.mad, + &response->grh, wc, + port_priv->device, + smi_get_fwd_port(&recv->mad.smp), + qp_info->qp->qp_num); goto out; } |