Commit 09d54630 authored by Qasim Ijaz's avatar Qasim Ijaz Committed by Jiri Kosina
Browse files

HID: thrustmaster: fix memory leak in thrustmaster_interrupts()



In thrustmaster_interrupts(), the allocated send_buf is not
freed if the usb_check_int_endpoints() check fails, leading
to a memory leak.

Fix this by ensuring send_buf is freed before returning in
the error path.

Fixes: 50420d7c ("HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check")
Signed-off-by: default avatarQasim Ijaz <qasdev00@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent c14e02e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
	u8 ep_addr[2] = {b_ep, 0};

	if (!usb_check_int_endpoints(usbif, ep_addr)) {
		kfree(send_buf);
		hid_err(hdev, "Unexpected non-int endpoint\n");
		return;
	}