From c1d7ebda11aae4659b665af61d7277dd351659b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Thu, 7 Jul 2022 14:56:59 +0200 Subject: [PATCH] ASoC: codecs: rt286: Set component to NULL on remove MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make sure that component is set to proper value, otherwise we may dereference freed component in interrupt. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220707125701.3518263-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/codecs/rt286.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index b2b0b2b..c4f7c4c 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -960,6 +960,7 @@ static void rt286_remove(struct snd_soc_component *component) struct rt286_priv *rt286 = snd_soc_component_get_drvdata(component); cancel_delayed_work_sync(&rt286->jack_detect_work); + rt286->component = NULL; } #ifdef CONFIG_PM -- 2.7.4