diff mbox series

thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()

Message ID 20230803095042.54743-1-mika.westerberg@linux.intel.com
State New
Headers show
Series thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() | expand

Commit Message

Mika Westerberg Aug. 3, 2023, 9:50 a.m. UTC
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(+)

Comments

Mika Westerberg Aug. 4, 2023, 1:20 p.m. UTC | #1
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.
diff mbox series

Patch

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)