diff options
author | Lizhi Hou <lizhi.hou@amd.com> | 2025-08-18 08:22:21 -0700 |
---|---|---|
committer | Rob Herring (Arm) <robh@kernel.org> | 2025-08-20 18:37:51 -0500 |
commit | c81f6ce16785cc07ae81f53deb07b662ed0bb3a5 (patch) | |
tree | 5ea55610025a7f903994c819e0ca753118d7cddd /tools/perf/scripts/python/flamegraph.py | |
parent | 79aef1a3705bbc95b36dad892af1f313490bd65c (diff) |
of: dynamic: Fix memleak when of_pci_add_properties() failed
When of_pci_add_properties() failed, of_changeset_destroy() is called to
free the changeset. And of_changeset_destroy() puts device tree node in
each entry but does not free property in the entry. This leads to memory
leak in the failure case.
In of_changeset_add_prop_helper(), add the property to the device tree node
deadprops list. Thus, the property will also be freed along with device
tree node.
Fixes: b544fc2b8606 ("of: dynamic: Add interfaces for creating device node dynamically")
Reported-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Closes: https://lore.kernel.org/all/aJms+YT8TnpzpCY8@lpieralisi/
Tested-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://lore.kernel.org/r/20250818152221.3685724-1-lizhi.hou@amd.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions