diff options
| author | Yang Yingliang <[email protected]> | 2022-11-21 14:24:16 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-11-22 17:28:17 +0100 |
| commit | 0384e87e3fec735e47f1c133c796f32ef7a72a9b (patch) | |
| tree | bd5c735ec0ee22e062134c44fbd404cdc27a0a9a /tools/perf/scripts/python/sctop.py | |
| parent | 6552ba4cd0841c23486368ed4feb2229e0abd1b3 (diff) | |
usb: typec: tcpci: fix of node refcount leak in tcpci_register_port()
I got the following report while doing device(mt6370-tcpc) load
test with CONFIG_OF_UNITTEST and CONFIG_OF_DYNAMIC enabled:
OF: ERROR: memory leak, expected refcount 1 instead of 2,
of_node_get()/of_node_put() unbalanced - destroy cset entry:
attach overlay node /i2c/pmic@34/tcpc/connector
The 'fwnode' set in tcpci_parse_config() which is called
in tcpci_register_port(), its node refcount is increased
in device_get_named_child_node(). It needs be put while
exiting, so call fwnode_handle_put() in the error path of
tcpci_register_port() and in tcpci_unregister_port() to
avoid leak.
Fixes: 5e85a04c8c0d ("usb: typec: add fwnode to tcpc")
Signed-off-by: Yang Yingliang <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions