bus: qcom: Put child node before return
authorPan Bian <bianpan2016@163.com>
Thu, 21 Jan 2021 11:49:07 +0000 (03:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:40:23 +0000 (10:40 +0200)
commita6191e91c10e50bd51db65a00e03d02b6b0cf8c4
treed0b57dd9de70d1c665ad91a12cd389c0e4c53475
parent9625b00cac6630479c0ff4b9fafa88bee636e1f0
bus: qcom: Put child node before return

[ Upstream commit ac6ad7c2a862d682bb584a4bc904d89fa7721af8 ]

Put child node before return to fix potential reference count leak.
Generally, the reference count of child is incremented and decremented
automatically in the macro for_each_available_child_of_node() and should
be decremented manually if the loop is broken in loop body.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210121114907.109267-1-bianpan2016@163.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/qcom-ebi2.c