提交 ac6ad7c2 编写于 作者: P Pan Bian 提交者: Bjorn Andersson

bus: qcom: Put child node before return

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: NLinus Walleij <linus.walleij@linaro.org>
Fixes: 335a1275 ("bus: qcom: add EBI2 driver")
Signed-off-by: NPan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210121114907.109267-1-bianpan2016@163.comSigned-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
上级 ddd6b726
...@@ -353,8 +353,10 @@ static int qcom_ebi2_probe(struct platform_device *pdev) ...@@ -353,8 +353,10 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
/* Figure out the chipselect */ /* Figure out the chipselect */
ret = of_property_read_u32(child, "reg", &csindex); ret = of_property_read_u32(child, "reg", &csindex);
if (ret) if (ret) {
of_node_put(child);
return ret; return ret;
}
if (csindex > 5) { if (csindex > 5) {
dev_err(dev, dev_err(dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册