Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs42l43: Add clear of stashed pointer on component remove

If the component is removed the stashed component pointer in the
CODECs private struct should also be cleared to prevent use of a stale
pointer.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240202140619.1068560-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
cd2a2388 b25c4e56

+8
+8
sound/soc/codecs/cs42l43.c
··· 2111 2111 return 0; 2112 2112 } 2113 2113 2114 + static void cs42l43_component_remove(struct snd_soc_component *component) 2115 + { 2116 + struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component); 2117 + 2118 + priv->component = NULL; 2119 + } 2120 + 2114 2121 static const struct snd_soc_component_driver cs42l43_component_drv = { 2115 2122 .name = "cs42l43-codec", 2116 2123 2117 2124 .probe = cs42l43_component_probe, 2125 + .remove = cs42l43_component_remove, 2118 2126 .set_sysclk = cs42l43_set_sysclk, 2119 2127 .set_jack = cs42l43_set_jack, 2120 2128