mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
of: reserved_mem: add missing of_node_put() for proper ref-counting
Commitd698a38814("of: reserved-memory: ignore disabled memory-region nodes") added an early return in of_reserved_mem_device_init_by_idx(), but didn't call of_node_put() on a device_node whose ref-count was incremented in the call to of_parse_phandle() preceding the early exit. Fixes:d698a38814("of: reserved-memory: ignore disabled memory-region nodes") Change-Id: I293be0fb7f86a1e6e4d4d7277039a881e590d5e0 Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
This commit is contained in:
parent
2a54c015b8
commit
79c240605e
1 changed files with 3 additions and 1 deletions
|
|
@ -324,8 +324,10 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
|
|||
if (!target)
|
||||
return -ENODEV;
|
||||
|
||||
if (!of_device_is_available(target))
|
||||
if (!of_device_is_available(target)) {
|
||||
of_node_put(target);
|
||||
return 0;
|
||||
}
|
||||
|
||||
rmem = __find_rmem(target);
|
||||
of_node_put(target);
|
||||
|
|
|
|||
Loading…
Reference in a new issue