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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eb7c2a20-3d9d-597c-c462-516bce30f82e@ti.com>
Date:   Mon, 6 Jun 2022 20:22:37 -0500
From:   Suman Anna <s-anna@...com>
To:     Miaoqian Lin <linmq006@...il.com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] remoteproc: k3-r5: Fix refcount leak in
 k3_r5_cluster_of_init

Hi Miaoqian,

On 6/5/22 03:33, Miaoqian Lin wrote:
> Every iteration of for_each_available_child_of_node() decrements
> the reference count of the previous node.
> When breaking early from a for_each_available_child_of_node() loop,
> we need to explicitly call of_node_put() on the child node.
> Add missing of_node_put() to avoid refcount leak.

Thanks for catching this.

> 
> Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>

Acked-by: Suman Anna <s-anna@...com>

regards
Suman

> ---
>  drivers/remoteproc/ti_k3_r5_remoteproc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> index 4840ad906018..0481926c6975 100644
> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> @@ -1655,6 +1655,7 @@ static int k3_r5_cluster_of_init(struct platform_device *pdev)
>  		if (!cpdev) {
>  			ret = -ENODEV;
>  			dev_err(dev, "could not get R5 core platform device\n");
> +			of_node_put(child);
>  			goto fail;
>  		}
>  
> @@ -1663,6 +1664,7 @@ static int k3_r5_cluster_of_init(struct platform_device *pdev)
>  			dev_err(dev, "k3_r5_core_of_init failed, ret = %d\n",
>  				ret);
>  			put_device(&cpdev->dev);
> +			of_node_put(child);
>  			goto fail;
>  		}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ