Re: [PATCH v2] dmaengine: ti: edma: fix OF node reference leaks in edma_driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 18, 2024 at 10:15:20AM +0900, Joe Hattori wrote:
>  drivers/dma/ti/edma.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index 343e986e66e7..4ece125b2ae7 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -208,7 +208,6 @@ struct edma_desc {
>  struct edma_cc;
>  
>  struct edma_tc {
> -	struct device_node		*node;
>  	u16				id;
>  };
>  
> @@ -2460,19 +2459,19 @@ static int edma_probe(struct platform_device *pdev)
>  			goto err_reg1;
>  		}
>  
> -		for (i = 0;; i++) {
> +		for (i = 0; i < ecc->num_tc; i++) {
>  			ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs",
>  							       1, i, &tc_args);
> -			if (ret || i == ecc->num_tc)

I feel bad for not saying this earlier, but probably this
"i < ecc->num_tc" change should be done as patch 1/2?  It's sort of
related because if we didn't do this then we'd have to do this we'd
have to re-write it to for the i == ecc->num_tc to add another
of_node_put(tc_args.np).  But really it needs to be reviewed
separately.  It's such a weird thing, that I have to think that it
was done deliberately for some reason although I can't figure out why.

The rest of the patch is nice.  So much simpler than v1.

regards,
dan carpenter





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux