powerpc: pseries: Fix refcount bug in ibmebus
PATCH 1/1 powerpc: pseries: Fix refcount bug in ibmebus
In ibmebus_match_path(), we should use of_node_put() to keep refcount balance.
Signed-off-by Liang He <[email protected]>
--- arch/powerpc/platforms/pseries/ibmebus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/platforms/pseries/ibmebus.c +5 -1
@@ -152,7 +152,11 @@ static const struct dma_map_ops ibmebus_dma_ops = {static int ibmebus_match_path (struct device *dev,const void *data) {struct device_node *dn =to_platform_device (dev)->dev.of_node; -return (of_find_node_by_path (data) == dn); +struct device_node *tn =of_find_node_by_path (data); + +of_node_put (tn); + +return (tn == dn); }static int ibmebus_match_node (struct device *dev,const void *data)
Signature · 1 line
2.25.1
Michael Ellerman
AppliedQuoted 4 lines · Liang He
In
ibmebus_match_path(), we should useof_node_put()to keep refcount balance.
Applied to powerpc/next.
[1/1] powerpc: pseries: Fix refcount bug in ibmebus
https://git.kernel.org/powerpc/c/1c754b49c002a965004b6a96d158f7ce554eb977
cheers