Skip to content

Commit 28ca6f1

Browse files
zijun-hugregkh
authored andcommitted
of: Fix refcount leakage for OF node returned by __of_get_dma_parent()
commit 5d009e024056ded20c5bb1583146b833b23bbd5a upstream. __of_get_dma_parent() returns OF device node @args.np, but the node's refcount is increased twice, by both of_parse_phandle_with_args() and of_node_get(), so causes refcount leakage for the node. Fix by directly returning the node got by of_parse_phandle_with_args(). Fixes: f83a6e5 ("of: address: Add support for the parent DMA bus") Cc: [email protected] Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 76db8a7 commit 28ca6f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/of/address.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ struct device_node *__of_get_dma_parent(const struct device_node *np)
595595
if (ret < 0)
596596
return of_get_parent(np);
597597

598-
return of_node_get(args.np);
598+
return args.np;
599599
}
600600
#endif
601601

0 commit comments

Comments
 (0)