Commit 21468d42 authored by Johan Hovold's avatar Johan Hovold Committed by Ben Hutchings

USB: serial: garmin_gps: fix memory leak on failed URB submit

commit c4ac4496 upstream.

Make sure to free the URB transfer buffer in case submission fails (e.g.
due to a disconnect).

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 9c44811b
......@@ -1075,6 +1075,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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment