Skip to content

Commit 883c1d6

Browse files
windhlstorulf
authored andcommitted
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: b360b11 ("mmc: core: allow to match the device tree to apply quirks") Signed-off-by: Liang He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 886201c commit 883c1d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mmc/core/quirks.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ static inline bool mmc_fixup_of_compatible_match(struct mmc_card *card,
163163
struct device_node *np;
164164

165165
for_each_child_of_node(mmc_dev(card->host)->of_node, np) {
166-
if (of_device_is_compatible(np, compatible))
166+
if (of_device_is_compatible(np, compatible)) {
167+
of_node_put(np);
167168
return true;
169+
}
168170
}
169171

170172
return false;

0 commit comments

Comments
 (0)