Skip to content

Commit

Permalink
HID: thrustmaster: Fix memory leak in thrustmaster_interrupts()
Browse files Browse the repository at this point in the history
thrustmaster_interrupts() does not free memory for send_buf when
usb_interrupt_msg() fails. This is fixed by the given patch.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Evgeny Novikov authored and Jiri Kosina committed Aug 20, 2021
1 parent df3a97b commit c3800ee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/hid-thrustmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ static void thrustmaster_interrupts(struct hid_device *hdev)

if (ret) {
hid_err(hdev, "setup data couldn't be sent\n");
kfree(send_buf);
return;
}
}
Expand Down

0 comments on commit c3800ee

Please sign in to comment.