Re: [PATCH] ASoC: ak4613: cancel dummy write work on component removal

From: Kuninori Morimoto

Date: Tue Nov 10 2026 - 18:49:03 EST



Hi Hyunjung

> ak4613_dai_trigger() schedules priv->dummy_write_work on playback start
> to issue the PW_MGMT1/PW_MGMT3 dummy writes from a non-atomic context.
> The worker dereferences ak4613_priv and accesses the component over I2C.
>
> priv is allocated with devm_kzalloc() and the component driver has no
> remove callback, so nothing cancels the work on unbind. If the device is
> unbound while the work is still pending, the worker runs after priv has
> been freed by devres, resulting in a use-after-free.
>
> Cancel the work from a component remove callback, which runs while priv
> and the component are still valid.
>
> Fixes: 03bbf9f5e4eb ("ASoC: ak4613: call dummy write for PW_MGMT1/3 when Playback")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hyunjung Ko <hj351016@xxxxxxxxx>
> ---

Yes, indeed.
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

Thank you for your help !!

Best regards
---
Kuninori Morimoto