thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 22 Jun 2023 11:59:12 +0000 (14:59 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 4 Aug 2023 13:17:47 +0000 (16:17 +0300)
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

index 62b26b7..3fb4553 100644 (file)
@@ -1964,6 +1964,8 @@ unlock:
 
        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)