Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>

+1
+1
drivers/usb/serial/garmin_gps.c
··· 1043 1043 "%s - usb_submit_urb(write bulk) failed with status = %d\n", 1044 1044 __func__, status); 1045 1045 count = status; 1046 + kfree(buffer); 1046 1047 } 1047 1048 1048 1049 /* we are done with this urb, so let the host driver