wlan-ap-Telecominfraproject/feeds/qca-wifi-7/ipq53xx/patches-6.1/0629-coresight-tmc-etr-fix-the-memory-leak.patch
John Crispin 68cf54d9f7 qca-wifi-7: update to ath12.5.5
Signed-off-by: John Crispin <john@phrozen.org>
2025-02-27 12:45:52 +01:00

31 lines
1.1 KiB
Diff

From b69c645f30d97f22e5a4a0ac4b56fb284af18fc5 Mon Sep 17 00:00:00 2001
From: Sridharan S N <quic_sridsn@quicinc.com>
Date: Mon, 20 Nov 2023 12:44:25 +0530
Subject: [PATCH] coresight: tmc-etr: fix the memory leak
In function tmc_etr_alloc_rsvd_buf, flat_buf is dynamically allocated
memory using kzalloc. But it is not freed leading to potential memory leak. Hence free the flat_buf.
Change-Id: I88504c938e8056cfcece23e390f46570d6f056fe
Signed-off-by: Sridharan S N <quic_sridsn@quicinc.com>
---
drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
index 9c04544dfb34..79c33ebedbe1 100644
--- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
@@ -722,6 +722,8 @@ static int tmc_etr_alloc_rsvd_buf(struct tmc_drvdata *drvdata,
*/
static void tmc_etr_free_rsvd_buf(struct etr_buf *etr_buf)
{
+ struct etr_flat_buf *flat_buf = etr_buf->private;
+ kfree(flat_buf);
}
--
2.34.1