mmc: core: quirks: Add of_node_put() when breaking out of loop
PATCH 1/1 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 b360b1102670 ("mmc: core: allow to match the device tree to apply quirks")
Signed-off-by Liang He <[email protected]>
--- drivers/mmc/core/quirks.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/core/quirks.h +3 -1
@@ -163,8 +163,10 @@ static inline bool mmc_fixup_of_compatible_match(struct mmc_card *card,struct device_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 false;
Signature · 1 line
2.25.1
Quoted 7 lines · Liang He
In
mmc_fixup_of_compatible_match(), we should callof_node_put()when breaking out offor_each_child_of_node()which will increase and decrease the refcount during one iteration.Fixes b360b1102670 ("mmc: core: allow to match the device tree to apply quirks")Signed-off-by Liang He <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 23 lines
--- drivers/mmc/core/quirks.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/mmc/core/quirks.h +3
-2@@ -163,8 +163,10 @@ static inline bool mmc_fixup_of_compatible_match(struct mmc_card *card,struct device_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 false; --2.25.1