lkml.org 
[lkml]   [2010]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[10/29] usb: serial: fix memory leak in generic driver
    2.6.32-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    From: Johan Hovold <jhovold@gmail.com>

    commit 2591530204a76fecc843529ade56afe865dd2657 upstream.

    Fix a regression introduced by commit
    715b1dc01fe44537e8fce9566e4bb48d6821d84b ("USB: usb_debug,
    usb_generic_serial: implement multi urb write").

    URB transfer buffer was never freed when using multi-urb writes.
    Currently the only driver enabling multi-urb writes is usb_debug.

    Signed-off-by: Johan Hovold <jhovold@gmail.com>
    Cc: Greg KH <greg@kroah.com>
    Acked-by: Jason Wessel <jason.wessel@windriver.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/usb/serial/generic.c | 2 ++
    1 file changed, 2 insertions(+)
    --- a/drivers/usb/serial/generic.c
    +++ b/drivers/usb/serial/generic.c
    @@ -489,6 +489,8 @@ void usb_serial_generic_write_bulk_callb
    dbg("%s - port %d", __func__, port->number);

    if (port->serial->type->max_in_flight_urbs) {
    + kfree(urb->transfer_buffer);
    +
    spin_lock_irqsave(&port->lock, flags);
    --port->urbs_in_flight;
    port->tx_bytes_flight -= urb->transfer_buffer_length;



    \
     
     \ /
      Last update: 2010-01-23 01:21    [W:0.835 / U:0.092 seconds]
    ©2003-2014 Jasper Spaans. hosted at Digital Ocean