memory: ti-aemif: Drop child node when jumping out loop
authorPan Bian <bianpan2016@163.com>
Thu, 21 Jan 2021 09:03:59 +0000 (01:03 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:25 +0000 (11:37 +0100)
commit509fe94c196f264f34d950bcc2521793c59cc4c2
treec47202d3fa3ad024d8ab955aaec4f73c6cd6d52c
parent63cb4aa9e4eee4cf79a2adacf140ddb14dc23bc5
memory: ti-aemif: Drop child node when jumping out loop

[ Upstream commit 94e9dd43cf327366388c8f146bccdc6322c0d999 ]

Call of_node_put() to decrement the reference count of the child node
child_np when jumping out of the loop body of
for_each_available_child_of_node(), which is a macro that increments and
decrements the reference count of child node. If the loop is broken, the
reference of the child node should be dropped manually.

Fixes: 5a7c81547c1d ("memory: ti-aemif: introduce AEMIF driver")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210121090359.61763-1-bianpan2016@163.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memory/ti-aemif.c