The twl6040 codec driver initializes a delayed work for headset jack detection (hs_jack.work) but the component remove callback only frees the plug IRQ without cancelling the pending work. If the IRQ fires and schedules the work shortly before removal, it can execute on freed memory. Add cancel_delayed_work_sync() in twl6040_remove() before freeing the IRQ to ensure no stale work remains queued. Fixes: a2d2362edf9f ("ASoC: twl6040: Add jack support for headset and handset") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- Changes in v2: - Resend as part of unified series (no code changes from v1) sound/soc/codecs/twl6040.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 650836f9615fb..43feb660b635b 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1135,6 +1135,7 @@ static void twl6040_remove(struct snd_soc_component *component) { struct twl6040_data *priv = snd_soc_component_get_drvdata(component); + cancel_delayed_work_sync(&priv->hs_jack.work); free_irq(priv->plug_irq, component); } -- 2.47.3