lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Dec 2021 01:16:29 +0530
From:   Tanmay Shah <tanmay.shah@...inx.com>
To:     Lars-Peter Clausen <lars@...afoo.de>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Michal Simek <michal.simek@...inx.com>
CC:     Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Ben Levinsky <ben.levinsky@...inx.com>,
        Bill Mills <bill.mills@...aro.org>,
        "Sergei Korneichuk" <sergei.korneichuk@...inx.com>,
        <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <devicetree@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc
 driver


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ