diff options
author | Johan Hovold <[email protected]> | 2023-03-06 08:56:29 +0100 |
---|---|---|
committer | Georgi Djakov <[email protected]> | 2023-03-07 22:19:05 +0200 |
commit | a5904f415e1af72fa8fe6665aa4f554dc2099a95 (patch) | |
tree | 16b5fb42e90fdc4016de12171f99710e7250f847 | |
parent | 633a12fda6536a1a17bcea29502e777e86a4547e (diff) |
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: [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]>
-rw-r--r-- | drivers/interconnect/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |