Skip to content

Commit a5904f4

Browse files
jhovoldGeorgi Djakov
authored andcommitted
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: 11f1cec ("interconnect: Add generic on-chip interconnect API") Cc: [email protected] # 5.1 Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Tested-by: Luca Ceresoli <[email protected]> # i.MX8MP MSC SM2-MB-EP1 Board Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent 633a12f commit a5904f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/interconnect/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,10 @@ void icc_node_destroy(int id)
850850

851851
mutex_unlock(&icc_lock);
852852

853+
if (!node)
854+
return;
855+
856+
kfree(node->links);
853857
kfree(node);
854858
}
855859
EXPORT_SYMBOL_GPL(icc_node_destroy);

0 commit comments

Comments
 (0)