Skip to content

Commit 4b8e089

Browse files
author
CKI Backport Bot
committed
HID: thrustmaster: fix memory leak in thrustmaster_interrupts()
JIRA: https://issues.redhat.com/browse/RHEL-81416 CVE: CVE-2024-57993 commit 09d5463 Author: Qasim Ijaz <qasdev00@gmail.com> Date: Thu Mar 27 23:11:46 2025 +0000 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: 50420d7 ("HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check") Signed-off-by: Qasim Ijaz <qasdev00@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
1 parent 8c8a3eb commit 4b8e089

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)