Re: [PATCH v2] regulator: disable disable_work for good in regulator_unregister()
From: Mark Brown
Date: Wed Nov 04 2026 - 08:57:30 EST
On Wed, Nov 04, 2026 at 09:48:38PM +0800, Chengyu Liu wrote:
> regulator_unregister() stops rdev->disable_work with
> flush_work(&dw->work), which is a no-op for a delayed_work pending on
> the timer wheel: flush_work() only waits for a queued or running work
> item. A disable deferred by a consumer's regulator_disable_deferred()
> therefore survives the provider's unbind, and regulator_disable_work()
> fires after device_unregister() has freed the rdev, dereferencing it
> via container_of(). Use-after-free.
Please don't send new patches in reply to old patches or serieses, this
makes it harder for both people and tools to understand what is going
on - it can bury things in mailboxes and make it difficult to keep track
of what current patches are, both for the new patches and the old ones.
Attachment:
signature.asc
Description: PGP signature