HID: thrustmaster: Fix memory leak in remove
authorEvgeny Novikov <novikov@ispras.ru>
Fri, 30 Jul 2021 16:51:09 +0000 (19:51 +0300)
committerJiri Kosina <jkosina@suse.cz>
Fri, 20 Aug 2021 12:24:57 +0000 (14:24 +0200)
thrustmaster_remove() does not release memory for
tm_wheel->change_request. This is fixed by the 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>
drivers/hid/hid-thrustmaster.c

index e94d340..9cb4248 100644 (file)
@@ -253,6 +253,7 @@ static void thrustmaster_remove(struct hid_device *hdev)
 
        usb_kill_urb(tm_wheel->urb);
 
+       kfree(tm_wheel->change_request);
        kfree(tm_wheel->response);
        kfree(tm_wheel->model_request);
        usb_free_urb(tm_wheel->urb);