public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>,
	Russell King <linux@armlinux.org.uk>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: OMAP2+: Fix refcount leak in omapdss_init_of
Date: Wed, 1 Jun 2022 09:50:59 +0300	[thread overview]
Message-ID: <YpcMU9o8w/zoDE+J@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220601044858.3352-1-linmq006@gmail.com>

Hello Lin,

Thank you for the patch.

On Wed, Jun 01, 2022 at 08:48:58AM +0400, Miaoqian Lin wrote:
> omapdss_find_dss_of_node() calls of_find_compatible_node() to get device
> node. of_find_compatible_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() in later error path and normal path.
> 
> Fixes: e0c827aca0730 ("drm/omap: Populate DSS children in omapdss driver")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  arch/arm/mach-omap2/display.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
> index 21413a9b7b6c..ed2cb2649cf6 100644
> --- a/arch/arm/mach-omap2/display.c
> +++ b/arch/arm/mach-omap2/display.c
> @@ -259,11 +259,13 @@ static int __init omapdss_init_of(void)
>  
>  	if (!pdev) {
>  		pr_err("Unable to find DSS platform device\n");
> +		of_node_put(node);
>  		return -ENODEV;
>  	}
>  
>  	r = of_platform_populate(node, NULL, NULL, &pdev->dev);
>  	put_device(&pdev->dev);
> +	of_node_put(node);
>  	if (r) {
>  		pr_err("Unable to populate DSS submodule devices\n");
>  		return r;

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2022-06-01  6:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01  4:48 [PATCH] ARM: OMAP2+: Fix refcount leak in omapdss_init_of Miaoqian Lin
2022-06-01  6:50 ` Laurent Pinchart [this message]
2022-06-28  4:36   ` Tony Lindgren

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=YpcMU9o8w/zoDE+J@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linmq006@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=sebastian.reichel@collabora.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.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