This is a note to let you know that I've just added the patch titled interconnect: fix mem leak when freeing nodes to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: interconnect-fix-mem-leak-when-freeing-nodes.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a5904f415e1af72fa8fe6665aa4f554dc2099a95 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Mon, 6 Mar 2023 08:56:29 +0100 Subject: interconnect: fix mem leak when freeing nodes From: Johan Hovold <johan+linaro@xxxxxxxxxx> commit a5904f415e1af72fa8fe6665aa4f554dc2099a95 upstream. 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@xxxxxxxxxxxxxxx # 5.1 Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Tested-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx> # i.MX8MP MSC SM2-MB-EP1 Board Link: https://lore.kernel.org/r/20230306075651.2449-2-johan+linaro@xxxxxxxxxx Signed-off-by: Georgi Djakov <djakov@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/interconnect/core.c | 4 ++++ 1 file changed, 4 insertions(+) --- 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); Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are queue-6.2/memory-tegra20-emc-fix-interconnect-registration-race.patch queue-6.2/memory-tegra124-emc-fix-interconnect-registration-race.patch queue-6.2/serial-qcom-geni-fix-console-shutdown-hang.patch queue-6.2/interconnect-exynos-fix-registration-race.patch queue-6.2/interconnect-imx-fix-registration-race.patch queue-6.2/memory-tegra30-emc-fix-interconnect-registration-race.patch queue-6.2/interconnect-qcom-msm8974-fix-registration-race.patch queue-6.2/memory-tegra-fix-interconnect-registration-race.patch queue-6.2/interconnect-qcom-rpm-fix-probe-child-node-error-handling.patch queue-6.2/interconnect-qcom-rpm-fix-registration-race.patch queue-6.2/interconnect-fix-provider-registration-api.patch queue-6.2/interconnect-fix-icc_provider_del-error-handling.patch queue-6.2/interconnect-qcom-rpmh-fix-registration-race.patch queue-6.2/interconnect-fix-mem-leak-when-freeing-nodes.patch queue-6.2/interconnect-qcom-rpmh-fix-probe-child-node-error-handling.patch queue-6.2/interconnect-exynos-fix-node-leak-in-probe-pm-qos-error-path.patch queue-6.2/interconnect-qcom-osm-l3-fix-registration-race.patch