提交 883c1d6f 编写于 作者: L Liang He 提交者: Ulf Hansson

mmc: core: quirks: Add of_node_put() when breaking out of loop

In mmc_fixup_of_compatible_match(), we should call of_node_put()
when breaking out of for_each_child_of_node() which will increase
and decrease the refcount during one iteration.

Fixes: b360b110 ("mmc: core: allow to match the device tree to apply quirks")
Signed-off-by: NLiang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220719091051.1210806-1-windhl@126.comSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 886201c7
...@@ -163,9 +163,11 @@ static inline bool mmc_fixup_of_compatible_match(struct mmc_card *card, ...@@ -163,9 +163,11 @@ static inline bool mmc_fixup_of_compatible_match(struct mmc_card *card,
struct device_node *np; struct device_node *np;
for_each_child_of_node(mmc_dev(card->host)->of_node, np) { for_each_child_of_node(mmc_dev(card->host)->of_node, np) {
if (of_device_is_compatible(np, compatible)) if (of_device_is_compatible(np, compatible)) {
of_node_put(np);
return true; return true;
} }
}
return false; return false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册