Re: [PATCH 04/10] regulator: arizona-micsupp: Cancel check_cp_work on device teardown

From: Charles Keepax

Date: Thu Nov 05 2026 - 05:33:39 EST


On Wed, Nov 04, 2026 at 06:20:54PM +0000, Lee Jones wrote:
> micsupp->check_cp_work is initialised with raw INIT_WORK() and is never
> cancelled when the regulator device is unbound or when registration
> fails after set_machine_constraints() has run, allowing a pending work
> item to dereference micsupp after devres frees it.
>
> Initialise check_cp_work with devm_work_autocancel() before registering
> the regulator so the work item is cancelled after regulator teardown and
> before micsupp is freed.
>
> Fixes: e6ed90581bfa ("regulator: arizona-micsupp: Enable SYSCLK for charge pump")
> Closes: https://sashiko.dev/#/bug/linux-3f85eadb-7493-4aea-9e4d-ce319b6e0688
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
> ---

Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>

Thanks,
Charles