USB: serial: garmin_gps: fix memory leak on failed URB submit
commit c4ac4496e835b78a45dfbf74f6173932217e4116 upstream.
Make sure to free the URB transfer buffer in case submission fails (e.g.
due to a disconnect).
Fixes: 1da177e4c3
("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e3d6a0da47
commit
f0bdd7e0cc
1 changed files with 1 additions and 0 deletions
|
@ -1044,6 +1044,7 @@ static int garmin_write_bulk(struct usb_serial_port *port,
|
|||
"%s - usb_submit_urb(write bulk) failed with status = %d\n",
|
||||
__func__, status);
|
||||
count = status;
|
||||
kfree(buffer);
|
||||
}
|
||||
|
||||
/* we are done with this urb, so let the host driver
|
||||
|
|
Loading…
Add table
Reference in a new issue