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