[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230306075651.2449-2-johan+linaro@kernel.org>
Date: Mon, 6 Mar 2023 08:56:29 +0100
From: Johan Hovold <johan+linaro@...nel.org>
To: Georgi Djakov <djakov@...nel.org>
Cc: "Shawn Guo" <shawnguo@...nel.org>,
"Sascha Hauer" <s.hauer@...gutronix.de>,
"Pengutronix Kernel Team" <kernel@...gutronix.de>,
"Fabio Estevam" <festevam@...il.com>,
"NXP Linux Team" <linux-imx@....com>,
"Andy Gross" <agross@...nel.org>,
"Bjorn Andersson" <andersson@...nel.org>,
"Konrad Dybcio" <konrad.dybcio@...aro.org>,
"Sylwester Nawrocki" <s.nawrocki@...sung.com>,
Artur Świgoń <a.swigon@...sung.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@...aro.org>,
"Alim Akhtar" <alim.akhtar@...sung.com>,
"Thierry Reding" <thierry.reding@...il.com>,
"Jonathan Hunter" <jonathanh@...dia.com>, linux-pm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
Johan Hovold <johan+linaro@...nel.org>, stable@...r.kernel.org
Subject: [PATCH v2 01/23] interconnect: fix mem leak when freeing nodes
The node link array is allocated when adding links to a node but is not
deallocated when nodes are destroyed.
Fixes: 11f1ceca7031 ("interconnect: Add generic on-chip interconnect API")
Cc: stable@...r.kernel.org # 5.1
Reviewed-by: Konrad Dybcio <konrad.dybcio@...aro.org>
Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
---
drivers/interconnect/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index 0f392f59b135..5217f449eeec 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -850,6 +850,10 @@ void icc_node_destroy(int id)
mutex_unlock(&icc_lock);
+ if (!node)
+ return;
+
+ kfree(node->links);
kfree(node);
}
EXPORT_SYMBOL_GPL(icc_node_destroy);
--
2.39.2
Powered by blists - more mailing lists