From: Helge Deller <deller@gmx.de>
To: Miaoqian Lin <linmq006@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Pawel Moll <pawel.moll@arm.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] video: fbdev: Fix refcount leak in clcdfb_of_vram_setup
Date: Thu, 19 May 2022 11:14:01 +0200 [thread overview]
Message-ID: <3976cf6a-0b40-4763-a233-eacf93925d53@gmx.de> (raw)
In-Reply-To: <20220512115913.48685-1-linmq006@gmail.com>
On 5/12/22 13:59, Miaoqian Lin wrote:
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: d10715be03bd ("video: ARM CLCD: Add DT support")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
applied to the fbdev tree.
Thanks!
Helge
> ---
> drivers/video/fbdev/amba-clcd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
> index 9ec969e136bf..8080116aea84 100644
> --- a/drivers/video/fbdev/amba-clcd.c
> +++ b/drivers/video/fbdev/amba-clcd.c
> @@ -758,12 +758,15 @@ static int clcdfb_of_vram_setup(struct clcd_fb *fb)
> return -ENODEV;
>
> fb->fb.screen_base = of_iomap(memory, 0);
> - if (!fb->fb.screen_base)
> + if (!fb->fb.screen_base) {
> + of_node_put(memory);
> return -ENOMEM;
> + }
>
> fb->fb.fix.smem_start = of_translate_address(memory,
> of_get_address(memory, 0, &size, NULL));
> fb->fb.fix.smem_len = size;
> + of_node_put(memory);
>
> return 0;
> }
prev parent reply other threads:[~2022-05-19 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 11:59 Miaoqian Lin
2022-05-19 9:14 ` Helge Deller [this message]
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=3976cf6a-0b40-4763-a233-eacf93925d53@gmx.de \
--to=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linmq006@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=pawel.moll@arm.com \
--cc=tomi.valkeinen@ti.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
all inboxes | Powered by JetHome®