From: Marc Zyngier <maz@kernel.org>
To: Daode Huang <huangdaode@hisilicon.com>
Cc: jason@lakedaemon.net, linux-kernel@vger.kernel.org,
fabien.dessenne@st.com, mcoquelin.stm32@gmail.com,
tglx@linutronix.de, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, alexandre.torgue@st.com
Subject: Re: [PATCH] irqchip/stm32: Fix "WARNING: invalid free of devm_ allocated
Date: Mon, 02 Dec 2019 12:40:40 +0000 [thread overview]
Message-ID: <028744c349410eb1f74b7e2b18590c75@www.loen.fr> (raw)
In-Reply-To: <8acaa494701c91b8a8acd60a2390d810@www.loen.fr>
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@hisilicon.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...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-02 12:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-28 9:04 [PATCH] irqchip/stm32: Fix "WARNING: invalid free of devm_ allocated Daode Huang
2019-12-02 12:29 ` Marc Zyngier
2019-12-02 12:40 ` Marc Zyngier [this message]
2019-12-02 13:22 ` Fabien DESSENNE
2019-12-02 13:32 ` 答复: " huangdaode
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=028744c349410eb1f74b7e2b18590c75@www.loen.fr \
--to=maz@kernel.org \
--cc=alexandre.torgue@st.com \
--cc=fabien.dessenne@st.com \
--cc=huangdaode@hisilicon.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).