* [PATCH] thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
@ 2023-08-03 9:50 Mika Westerberg
2023-08-04 13:20 ` Mika Westerberg
0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2023-08-03 9:50 UTC (permalink / raw)
To: linux-usb
Cc: Yehezkel Bernat, Michael Jamet, Lukas Wunner, Andreas Noever,
Mika Westerberg
The memory allocated in tb_queue_dp_bandwidth_request() needs to be
released once the request is handled to avoid leaking it.
Fixes: 6ce3563520be ("thunderbolt: Add support for DisplayPort bandwidth allocation mode")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/tb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 62b26b7998fd..3fb4553a6442 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -1964,6 +1964,8 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
pm_runtime_mark_last_busy(&tb->dev);
pm_runtime_put_autosuspend(&tb->dev);
+
+ kfree(ev);
}
static void tb_queue_dp_bandwidth_request(struct tb *tb, u64 route, u8 port)
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
2023-08-03 9:50 [PATCH] thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() Mika Westerberg
@ 2023-08-04 13:20 ` Mika Westerberg
0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2023-08-04 13:20 UTC (permalink / raw)
To: linux-usb; +Cc: Yehezkel Bernat, Michael Jamet, Lukas Wunner, Andreas Noever
On Thu, Aug 03, 2023 at 12:50:42PM +0300, Mika Westerberg wrote:
> The memory allocated in tb_queue_dp_bandwidth_request() needs to be
> released once the request is handled to avoid leaking it.
>
> Fixes: 6ce3563520be ("thunderbolt: Add support for DisplayPort bandwidth allocation mode")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Applied to thunderbolt.git/fixes.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-04 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 9:50 [PATCH] thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() Mika Westerberg
2023-08-04 13:20 ` Mika Westerberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).