All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mukesh Ojha <mojha@codeaurora.org>
To: Wen Yang <wen.yang99@zte.com.cn>, linux-kernel@vger.kernel.org
Cc: wang.yi59@zte.com.cn, Tomi Valkeinen <tomi.valkeinen@ti.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	Markus Elfring <Markus.Elfring@web.de>
Subject: Re: [PATCH v2] drm/omap: fix possible object reference leak
Date: Mon, 8 Apr 2019 14:19:27 +0530	[thread overview]
Message-ID: <60d46048-950a-f6f1-0242-bcbfb093b647@codeaurora.org> (raw)
In-Reply-To: <1554692313-28882-2-git-send-email-wen.yang99@zte.com.cn>


On 4/8/2019 8:28 AM, Wen Yang wrote:
> The call to of_find_matching_node returns a node pointer with refcount
> incremented thus it must be explicitly decremented after the last
> usage.
>
> Detected by coccinelle with the following warnings:
> drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c:212:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 209, but without a corresponding object release within this function.
> drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c:237:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 209, but without a corresponding object release within this function.
>
> Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Markus Elfring <Markus.Elfring@web.de>
> ---
> v2->v1: add a jump target.
>
>   drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
> index 2b41c75..13b3b4a 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
> @@ -209,7 +209,7 @@ static int __init omapdss_boot_init(void)
>   	dss = of_find_matching_node(NULL, omapdss_of_match);
>   
>   	if (dss == NULL || !of_device_is_available(dss))
> -		return 0;
> +		goto put_node;
>   
>   	omapdss_walk_device(dss, true);
>   
> @@ -234,6 +234,8 @@ static int __init omapdss_boot_init(void)
>   		kfree(n);
>   	}
>   
> +put_node:
> +	of_node_put(dss);
>   	return 0;
>   }
>   

  reply	other threads:[~2019-04-08  8:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08  2:58 [PATCH v2] drm/meson: fix possible object reference leak Wen Yang
2019-04-08  2:58 ` Wen Yang
2019-04-08  2:58 ` Wen Yang
2019-04-08  2:58 ` Wen Yang
2019-04-08  2:58 ` [PATCH v2] drm/omap: " Wen Yang
2019-04-08  8:49   ` Mukesh Ojha [this message]
2019-04-08  2:58 ` [PATCH v2] drm: rcar-du: " Wen Yang
2019-04-08  8:45   ` Mukesh Ojha
2019-04-08  9:23     ` wen.yang99
2019-04-08 16:38   ` Markus Elfring
2019-04-08  9:13 ` [PATCH v2] drm/meson: " Markus Elfring
2019-04-08  9:13   ` Markus Elfring
2019-04-08  9:13   ` Markus Elfring
2019-04-08 10:25   ` wen.yang99

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=60d46048-950a-f6f1-0242-bcbfb093b647@codeaurora.org \
    --to=mojha@codeaurora.org \
    --cc=Markus.Elfring@web.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=wang.yi59@zte.com.cn \
    --cc=wen.yang99@zte.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.