[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <028744c349410eb1f74b7e2b18590c75@www.loen.fr>
Date: Mon, 02 Dec 2019 12:40:40 +0000
From: Marc Zyngier <maz@...nel.org>
To: Daode Huang <huangdaode@...ilicon.com>
Cc: <jason@...edaemon.net>, <linux-kernel@...r.kernel.org>,
<fabien.dessenne@...com>, <mcoquelin.stm32@...il.com>,
<tglx@...utronix.de>, <linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>, <alexandre.torgue@...com>
Subject: Re: [PATCH] irqchip/stm32: Fix "WARNING: invalid free of devm_ allocated
On 2019-12-02 12:29, Marc Zyngier wrote:
> On 2019-11-28 09:04, Daode Huang wrote:
>> Since devm_ allocated data can be automaitcally released, it's no
>> need to free it apparently, just remove it.
>>
>> Fixes: cfbf9e497094 ("irqchip/stm32: Use a platform driver for
>> stm32mp1-exti device")
>> Signed-off-by: Daode Huang <huangdaode@...ilicon.com>
>> ---
>> drivers/irqchip/irq-stm32-exti.c | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/irqchip/irq-stm32-exti.c
>> b/drivers/irqchip/irq-stm32-exti.c
>> index e00f2fa..46ec0af 100644
>> --- a/drivers/irqchip/irq-stm32-exti.c
>> +++ b/drivers/irqchip/irq-stm32-exti.c
>> @@ -779,8 +779,6 @@ static int __init stm32_exti_init(const struct
>> stm32_exti_drv_data *drv_data,
>> irq_domain_remove(domain);
>> out_unmap:
>> iounmap(host_data->base);
>> - kfree(host_data->chips_data);
>> - kfree(host_data);
>> return ret;
>> }
>
> Applied, thanks.
Scratch that. This patch is just wrong, and just reading the code
makes it obvious. stm32_exti_init() is only called on paths
that allocate the memory with kmalloc.
Clearly you haven't tried to understand what is going on.
M.
--
Jazz is not dead. It just smells funny...
Powered by blists - more mailing lists