Commit 1c754b49 authored by Liang He's avatar Liang He Committed by Michael Ellerman

powerpc/pseries: Add missing of_node_put() in ibmebus

In ibmebus_match_path(), use of_node_put() to drop the reference
returned by of_find_node_by_path() before testing for equality of the
pointers.
Signed-off-by: default avatarLiang He <windhl@126.com>
[mpe: Rewrite change log]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220619074016.4068105-1-windhl@126.com
parent f4f8320b
...@@ -152,7 +152,11 @@ static const struct dma_map_ops ibmebus_dma_ops = { ...@@ -152,7 +152,11 @@ static const struct dma_map_ops ibmebus_dma_ops = {
static int ibmebus_match_path(struct device *dev, const void *data) static int ibmebus_match_path(struct device *dev, const void *data)
{ {
struct device_node *dn = to_platform_device(dev)->dev.of_node; 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) static int ibmebus_match_node(struct device *dev, const void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment