All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Oder Chiou <oder_chiou@realtek.com>, Mark Brown <broonie@kernel.org>
Cc: "Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>,
	"Cezary Rojewski" <cezary.rojewski@intel.com>,
	alsa-devel@alsa-project.org, "Takashi Iwai" <tiwai@suse.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Subject: [PATCH v2 3/5] ASoC: codecs: rt286: Set component to NULL on remove
Date: Thu,  7 Jul 2022 14:56:59 +0200	[thread overview]
Message-ID: <20220707125701.3518263-4-amadeuszx.slawinski@linux.intel.com> (raw)
In-Reply-To: <20220707125701.3518263-1-amadeuszx.slawinski@linux.intel.com>

Make sure that component is set to proper value, otherwise we may
dereference freed component in interrupt.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 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 b2b0b2b1e4d0..c4f7c4c2d793 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.25.1


  parent reply	other threads:[~2022-07-07 12:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 12:56 [PATCH v2 0/5] ASoC: codecs: Series of fixes for realtek codecs used on RVPs Amadeusz Sławiński
2022-07-07 12:56 ` [PATCH v2 1/5] ASoC: codecs: rt298: Fix NULL jack in interrupt Amadeusz Sławiński
2022-07-07 12:56 ` [PATCH v2 2/5] ASoC: codecs: rt298: Fix jack detection Amadeusz Sławiński
2022-07-07 12:56 ` Amadeusz Sławiński [this message]
2022-07-07 12:57 ` [PATCH v2 4/5] ASoC: codecs: rt298: Set component to NULL on remove Amadeusz Sławiński
2022-07-07 12:57 ` [PATCH v2 5/5] ASoC: codecs: rt274: " Amadeusz Sławiński
2022-07-11 16:01 ` [PATCH v2 0/5] ASoC: codecs: Series of fixes for realtek codecs used on RVPs Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220707125701.3518263-4-amadeuszx.slawinski@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.