From: Liang He <windhl@126.com>
To: deller@gmx.de, christophe.leroy@csgroup.eu
Cc: windhl@126.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] video: fbdev: Fix refcount leak bug in valkyriefb.c
Date: Sat, 18 Jun 2022 10:56:47 +0800 [thread overview]
Message-ID: <20220618025647.4057077-1-windhl@126.com> (raw)
In valkyriefb_init(), of_find_node_by_name() will return a node pointer
with refcount incremented. We should use of_node_put() in fail path or
when it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
---
drivers/video/fbdev/valkyriefb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c
index a6c9d4f26669..20d727a8069d 100644
--- a/drivers/video/fbdev/valkyriefb.c
+++ b/drivers/video/fbdev/valkyriefb.c
@@ -334,10 +334,13 @@ int __init valkyriefb_init(void)
return 0;
if (of_address_to_resource(dp, 0, &r)) {
+ of_node_put(dp);
printk(KERN_ERR "can't find address for valkyrie\n");
return 0;
}
+ of_node_put(dp);
+
frame_buffer_phys = r.start;
cmap_regs_phys = r.start + 0x304000;
}
--
2.25.1
reply other threads:[~2022-06-18 2:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220618025647.4057077-1-windhl@126.com \
--to=windhl@126.com \
--cc=christophe.leroy@csgroup.eu \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®