Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4ac4496 authored by Johan Hovold's avatar Johan Hovold
Browse files

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: 1da177e4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 3dca0111
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1043,6 +1043,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