Skip to contentSkip to conversation

thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()

PATCH Applied Mika Westerberg 1 participant 2 messages Aug 3, 2023 – Aug 4, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()

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")
---
 drivers/thunderbolt/tb.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/thunderbolt/tb.c +2 -0
index 62b26b7998fd..3fb4553a6442 100644
@@ -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)
Signature · 1 line
2.40.1
author Applied
#1 lore raw
Quoted 6 lines · 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")

Applied to thunderbolt.git/fixes.