mirror of
https://github.com/torvalds/linux.git
synced 2026-12-01 19:12:36 +00:00
of_find_node_by_path() returns a device_node with its refcount
incremented. When kstrtoint() fails or dt_alloc() fails, the function
continues to the next iteration without calling of_node_put(), causing
a reference count leak.
Add of_node_put(np) before continue on both error paths to properly
release the device_node reference.
Fixes: 611cad7201 ("dt: add of_alias_scan and of_alias_get_id")
Cc: [email protected]
Signed-off-by: Weigang He <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Rob Herring (Arm) <[email protected]>