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 5.4-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-5.4 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 @@ -612,6 +612,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-5.4/interconnect-fix-mem-leak-when-freeing-nodes.patch