All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peng Hao <peng.hao2@zte.com.cn>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, wen.yang99@zte.com.cn
Subject: Re: [PATCH] arm/mach-omap2/display: fix possible object reference leak
Date: Tue, 19 Feb 2019 09:58:14 -0800	[thread overview]
Message-ID: <20190219175814.GO15711@atomide.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1902191830490.27989@hadrien>

* Julia Lawall <julia.lawall@lip6.fr> [190219 17:33]:
> On Tue, 19 Feb 2019, Tony Lindgren wrote:
> > In general, if the device tree node is never used afterwards,
> > should this be just:
> >
> > 	r = of_platform_populate(node, NULL, NULL, &pdev->dev);
> > 	of_node_put(dev_node);
> > 	if (r) {
> > 		...
> > 	}
> >
> > If so, Julia might have a Coccinelle recpipe for it?
> 
> Unfortunately this is not really an ideal case for Coccinelle, because
> node is the result of calling a local function and Coccinelle doesn't by
> default do any interprocedural analysis.  It is possible to write a rule
> that explicitly looks for one function that returns a device node and then
> the pattern of its usage in the caller, though.

OK thanks for the information.

Regards,

Tony

WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Rob Herring <robh@kernel.org>, Peng Hao <peng.hao2@zte.com.cn>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-omap@vger.kernel.org, wen.yang99@zte.com.cn,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm/mach-omap2/display: fix possible object reference leak
Date: Tue, 19 Feb 2019 09:58:14 -0800	[thread overview]
Message-ID: <20190219175814.GO15711@atomide.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1902191830490.27989@hadrien>

* Julia Lawall <julia.lawall@lip6.fr> [190219 17:33]:
> On Tue, 19 Feb 2019, Tony Lindgren wrote:
> > In general, if the device tree node is never used afterwards,
> > should this be just:
> >
> > 	r = of_platform_populate(node, NULL, NULL, &pdev->dev);
> > 	of_node_put(dev_node);
> > 	if (r) {
> > 		...
> > 	}
> >
> > If so, Julia might have a Coccinelle recpipe for it?
> 
> Unfortunately this is not really an ideal case for Coccinelle, because
> node is the result of calling a local function and Coccinelle doesn't by
> default do any interprocedural analysis.  It is possible to write a rule
> that explicitly looks for one function that returns a device node and then
> the pattern of its usage in the caller, though.

OK thanks for the information.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-02-19 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 15:32 [PATCH] arm/mach-omap2/display: fix possible object reference leak Peng Hao
2019-02-13 15:32 ` Peng Hao
2019-02-19 17:05 ` Tony Lindgren
2019-02-19 17:05   ` Tony Lindgren
2019-02-19 17:30   ` Julia Lawall
2019-02-19 17:30     ` Julia Lawall
2019-02-20  2:41     ` [PATCH] arm/mach-omap2/display: fix possible object referenceleak wen.yang99
2019-02-19 17:33   ` [PATCH] arm/mach-omap2/display: fix possible object reference leak Julia Lawall
2019-02-19 17:33     ` Julia Lawall
2019-02-19 17:58     ` Tony Lindgren [this message]
2019-02-19 17:58       ` 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=20190219175814.GO15711@atomide.com \
    --to=tony@atomide.com \
    --cc=devicetree@vger.kernel.org \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=peng.hao2@zte.com.cn \
    --cc=robh@kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --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.