From: Liang He <windhl@126.com>
To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org,
dan.j.williams@intel.com, t.scherer@eckelmann.de,
vilhelm.gray@gmail.com, rafael@kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, windhl@126.com
Subject: [PATCH] powerpc: pseries: Fix refcount bug in ibmebus
Date: Sun, 19 Jun 2022 15:40:16 +0800 [thread overview]
Message-ID: <20220619074016.4068105-1-windhl@126.com> (raw)
In ibmebus_match_path(), we should use of_node_put() to keep
refcount balance.
Signed-off-by: Liang He <windhl@126.com>
---
arch/powerpc/platforms/pseries/ibmebus.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c
index 7ee3ed7d6cc2..a870cada7acd 100644
--- a/arch/powerpc/platforms/pseries/ibmebus.c
+++ b/arch/powerpc/platforms/pseries/ibmebus.c
@@ -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)
--
2.25.1
next reply other threads:[~2022-06-19 7:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-19 7:40 Liang He [this message]
2022-09-09 12:07 ` [PATCH] powerpc: pseries: Fix refcount bug in ibmebus Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220619074016.4068105-1-windhl@126.com \
--to=windhl@126.com \
--cc=benh@kernel.crashing.org \
--cc=dan.j.williams@intel.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=rafael@kernel.org \
--cc=t.scherer@eckelmann.de \
--cc=vilhelm.gray@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).