Skip to content

Commit 4885b1f

Browse files
qasim-ijazjfvogel
authored andcommitted
HID: thrustmaster: fix memory leak in thrustmaster_interrupts()
[ Upstream commit 09d546303b370113323bfff456c4e8cff8756005 ] 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: 50420d7 ("HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check") Signed-off-by: Qasim Ijaz <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit a6999953707a9c63cbddbef8eb74bf20cde18f67) Signed-off-by: Jack Vogel <[email protected]>
1 parent 36a9435 commit 4885b1f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/hid/hid-thrustmaster.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
174174
u8 ep_addr[2] = {b_ep, 0};
175175

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

0 commit comments

Comments
 (0)