summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEvgeny Novikov <novikov@ispras.ru>2021-07-30 19:53:33 +0300
committerJiri Kosina <jkosina@suse.cz>2021-08-20 15:24:57 +0300
commitc3800eed22d21c66912b4461a403b4448ed88d95 (patch)
treeee713d2471dcfd77e322033de5e73dd4705aa407 /drivers
parentdf3a97bdbc252d3421f1c5d6d713ad6e4f36a469 (diff)
downloadlinux-c3800eed22d21c66912b4461a403b4448ed88d95.tar.xz
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-thrustmaster.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c
index 9cb4248f95af..d44550aa8805 100644
--- a/drivers/hid/hid-thrustmaster.c
+++ b/drivers/hid/hid-thrustmaster.c
@@ -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;
}
}