HID: thrustmaster: Fix memory leak in thrustmaster_interrupts()

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>
This commit is contained in:
Evgeny Novikov 2021-07-30 19:53:33 +03:00 committed by Jiri Kosina
parent df3a97bdbc
commit c3800eed22

View File

@ -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;
}
}