lkml.org 
[lkml]   [2011]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[08/53] Net, libertas: Resolve memory leak in if_spi_host_to_card()
    3.0-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Jesper Juhl <jj@chaosbits.net>

    commit fe09b32a4361bea44169b2063e8c867cabb6a8ba upstream.

    If we hit the default case in the switch in if_spi_host_to_card() we'll leak
    the memory we allocated for 'packet'. This patch resolves the leak by freeing
    the allocated memory in that case.

    Signed-off-by: Jesper Juhl <jj@chaosbits.net>
    Acked-by: Dan Williams <dcbw@redhat.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/net/wireless/libertas/if_spi.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/drivers/net/wireless/libertas/if_spi.c
    +++ b/drivers/net/wireless/libertas/if_spi.c
    @@ -997,6 +997,7 @@ static int if_spi_host_to_card(struct lb
    spin_unlock_irqrestore(&card->buffer_lock, flags);
    break;
    default:
    + kfree(packet);
    netdev_err(priv->dev, "can't transfer buffer of type %d\n",
    type);
    err = -EINVAL;



    \
     
     \ /
      Last update: 2011-11-23 01:45    [W:2.320 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site