* [PATCH 3/3] HID: thrustmaster: Fix memory leak in thrustmaster_interrupts()
@ 2021-07-30 16:53 ` Evgeny Novikov
0 siblings, 0 replies; 2+ messages in thread
From: Evgeny Novikov @ 2021-07-30 16:53 UTC (permalink / raw)
To: Jiri Kosina
Cc: Evgeny Novikov, Benjamin Tissoires, Maxime Coquelin,
Alexandre Torgue, linux-input, linux-stm32, linux-arm-kernel,
linux-kernel, ldv-project
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>
---
drivers/hid/hid-thrustmaster.c | 1 +
1 file changed, 1 insertion(+)
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;
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 3/3] HID: thrustmaster: Fix memory leak in thrustmaster_interrupts()
@ 2021-07-30 16:53 ` Evgeny Novikov
0 siblings, 0 replies; 2+ messages in thread
From: Evgeny Novikov @ 2021-07-30 16:53 UTC (permalink / raw)
To: Jiri Kosina
Cc: Evgeny Novikov, Benjamin Tissoires, Maxime Coquelin,
Alexandre Torgue, linux-input, linux-stm32, linux-arm-kernel,
linux-kernel, ldv-project
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>
---
drivers/hid/hid-thrustmaster.c | 1 +
1 file changed, 1 insertion(+)
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;
}
}
--
2.26.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-30 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 16:53 [PATCH 3/3] HID: thrustmaster: Fix memory leak in thrustmaster_interrupts() Evgeny Novikov
2021-07-30 16:53 ` Evgeny Novikov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.