linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tanmay Shah <tanmay.shah@xilinx.com>
To: Lars-Peter Clausen <lars@metafoo.de>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Michal Simek <michal.simek@xilinx.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Ben Levinsky <ben.levinsky@xilinx.com>,
	Bill Mills <bill.mills@linaro.org>,
	"Sergei Korneichuk" <sergei.korneichuk@xilinx.com>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc driver
Date: Tue, 14 Dec 2021 01:16:29 +0530	[thread overview]
Message-ID: <a8505570-6d9f-bd56-e98c-e25ea17a8670@xilinx.com> (raw)
In-Reply-To: <b8b24b65-786b-2a4e-5548-5e5e8bf988be@metafoo.de>


On 12/14/21 1:13 AM, Lars-Peter Clausen wrote:
> On 12/13/21 8:31 PM, Tanmay Shah wrote:
>>>> +static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)
>>>> +{
>>>> [...]
>>>> +
>>>>
>>>> +    i = 0;
>>>> +    for_each_available_child_of_node(dev_node, child) {
>>>> +        child_pdev = of_find_device_by_node(child);
>>>> +        if (!child_pdev)
>>> A return or a break in a for_each_available_child_of_node() will 
>>> leak the reference to the child node.
>>
>> Do you mean I have to use of_put_node for each child?
>
> You have to put a `of_put_node(child)` before each break or return in 
> the loop.
>
> If you search the kernel commit history for 
> for_each_available_child_of_node or for_each_child_of_node you'll find 
> many fixes for similar problems. For example 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1b391e9712db
>
I got it. Same concern was posted by Mathieu also. I will address these 
comments in next revision.

Thanks,

Tanmay


      reply	other threads:[~2021-12-13 19:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  6:20 [PATCH v2 0/6] Add Xilinx RPU subsystem support Tanmay Shah
2021-11-23  6:20 ` [PATCH v2 1/6] dt-bindings: remoteproc: Add Xilinx RPU subsystem bindings Tanmay Shah
2021-11-23  6:20 ` [PATCH v2 2/6] arm64: dts: xilinx: zynqmp: Add RPU subsystem device node Tanmay Shah
2021-11-29 17:58   ` Mathieu Poirier
2021-11-30  8:01     ` Tanmay Shah
2021-11-23  6:20 ` [PATCH v2 3/6] firmware: xilinx: Add ZynqMP firmware ioctl enums for RPU configuration Tanmay Shah
2021-11-23  6:20 ` [PATCH v2 4/6] firmware: xilinx: Add shutdown/wakeup APIs Tanmay Shah
2021-11-23  6:20 ` [PATCH v2 5/6] firmware: xilinx: Add RPU configuration APIs Tanmay Shah
2021-11-23  6:20 ` [PATCH v2 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc driver Tanmay Shah
2021-11-29 18:42   ` Mathieu Poirier
2021-11-30  8:01     ` Tanmay Shah
2021-11-30 20:14       ` Mathieu Poirier
2021-12-01 18:37         ` Tanmay Shah
2021-12-03 18:55   ` Mathieu Poirier
2021-12-06 11:03     ` Tanmay Shah
2021-12-13  8:10     ` Tanmay Shah
2021-12-13 18:39       ` Mathieu Poirier
2021-12-06 19:04   ` Mathieu Poirier
2021-12-13 19:11     ` Tanmay Shah
2021-12-07 18:31   ` Mathieu Poirier
2021-12-13 19:17     ` Tanmay Shah
2022-02-07 18:57     ` Tanmay Shah
2022-02-08 16:54       ` Mathieu Poirier
2022-02-09 10:23         ` Tanmay Shah
2021-12-13 11:08   ` Lars-Peter Clausen
2021-12-13 19:31     ` Tanmay Shah
2021-12-13 19:43       ` Lars-Peter Clausen
2021-12-13 19:46         ` Tanmay Shah [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=a8505570-6d9f-bd56-e98c-e25ea17a8670@xilinx.com \
    --to=tanmay.shah@xilinx.com \
    --cc=ben.levinsky@xilinx.com \
    --cc=bill.mills@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=michal.simek@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=sergei.korneichuk@xilinx.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;
as well as URLs for NNTP newsgroup(s).