[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04935513-dea8-ab98-ed97-8ef778e44318@gmail.com>
Date: Mon, 8 Nov 2021 19:40:27 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: cgel.zte@...il.com
Cc: tglx@...utronix.de, maz@...nel.org,
bcm-kernel-feedback-list@...adcom.com, linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
Ye Guojin <ye.guojin@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] irqchip/irq-bcm7120-l2: add put_device() after
of_find_device_by_node()
On 11/8/2021 7:29 PM, cgel.zte@...il.com wrote:
> From: Ye Guojin <ye.guojin@....com.cn>
>
> This was found by coccicheck:
> ./drivers/irqchip/irq-bcm7120-l2.c,328,1-7,ERROR missing put_device;
> call of_find_device_by_node on line 234, but without a corresponding
> object release within this function.
> ./drivers/irqchip/irq-bcm7120-l2.c,341,1-7,ERROR missing put_device;
> call of_find_device_by_node on line 234, but without a corresponding
> object release within this function.
>
> Addtionally, fixup the potential problem that memory is not released
> before return.
>
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Ye Guojin <ye.guojin@....com.cn>
> ---
> drivers/irqchip/irq-bcm7120-l2.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
> index d80e67a6aad2..aaa70619f3c0 100644
> --- a/drivers/irqchip/irq-bcm7120-l2.c
> +++ b/drivers/irqchip/irq-bcm7120-l2.c
> @@ -325,7 +325,7 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
> pr_info("registered %s intc (%pOF, parent IRQ(s): %d)\n",
> intc_name, dn, data->num_parent_irqs);
>
> - return 0;
> + ret = 0;
That cannot be right, we would take the irq_free_domain label and
unregister the interrupt domain. The put_device() ought to be done when
we stop making use of the platform_device, that is at line 246 after we
call platform_irq_count().
Thanks!
--
Florian
Powered by blists - more mailing lists