[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131107002959.GA32200@mtj.dyndns.org>
Date: Thu, 7 Nov 2013 09:29:59 +0900
From: "tj@...nel.org" <tj@...nel.org>
To: "Liu, Chuansheng" <chuansheng.liu@...el.com>
Cc: Greg KH <gregkh@...uxfoundation.org>,
"dmitry.torokhov@...il.com" <dmitry.torokhov@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] devres: Freeing the drs after all release() are called
Hello, Liu.
On Thu, Nov 07, 2013 at 12:27:56AM +0000, Liu, Chuansheng wrote:
> The driver code is as below:
> _INIT() {
>
> A = devm_kzalloc();
> B= devm_request_threaded_irq(isr_handler);
> C = devm_kzalloc();
> }
>
> When driver _EXIT, the devres_release_all () will be called.
> The C will be kfreed before B, but when freeing irq B, the pending isr_handler() possibly
> will access the memory B which has been freed.
> Then the memory corruption occurred.
>
> This patch can solve this scenario.
Isn't the bug there IRQ being requested before all its resources are
allocated? The proposed change just masks the underlying issue or
incorrectly ordered operations.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists