From: Amadeusz Sławiński Date: Thu, 7 Jul 2022 12:57:00 +0000 (+0200) Subject: ASoC: codecs: rt298: Set component to NULL on remove X-Git-Tag: v6.0-rc1~93^2~9^2~27^2~19^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af3b33b9707d453a12e0cf5ac35d7b97b3524ace;p=thirdparty%2Fkernel%2Flinux.git ASoC: codecs: rt298: Set component to NULL on remove 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-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index e1d94f128fd94..b0b53d4f07df9 100644 --- a/sound/soc/codecs/rt298.c +++ b/sound/soc/codecs/rt298.c @@ -1022,6 +1022,7 @@ static void rt298_remove(struct snd_soc_component *component) struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component); cancel_delayed_work_sync(&rt298->jack_detect_work); + rt298->component = NULL; } #ifdef CONFIG_PM