[Ksummit-discuss] [TECH TOPIC] Fix devm_kzalloc, its users, or both

Dmitry Torokhov dmitry.torokhov at gmail.com
Fri Aug 21 02:19:51 UTC 2015


On Fri, Jul 31, 2015 at 8:14 AM, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
> Hello,
>
> It recently came to my attention that the way devm_kzalloc() is used by most
> drivers is broken. I've raised the topic on LKML (see
> http://lkml.org/lkml/2015/7/14/741) in the hope that my findings were simply
> wrong, but it turned out I was unfortunately right. As the topic spans lots of
> subsystems I believe it would be a good technical topic for the Kernel Summit.

<skip>

Just realized another fun fact: most busses execute
dev_pm_domain_detach() in bus' remove() method, but devm-managed
resources (including interrupts and such) are only released in driver
core, which happens after bus' remove() method returns. So we may end
up shutting off PM domain of a device that is still active and may
generate interrupts, etc.

Fun, huh?

Thanks.

-- 
Dmitry


More information about the Ksummit-discuss mailing list