aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmadeusz Sławiński <[email protected]>2025-07-08 10:50:09 +0000
committerMark Brown <[email protected]>2025-07-08 13:54:40 +0000
commita609bd74b8680dba62c44f7e6d00d381ddb2d3c0 (patch)
treea4312f51f21d8b7cce91cfbcfd8f2dd83aea908a
parentASoC: amd: yc: add DMI quirk for ASUS M6501RM (diff)
downloadkernel-a609bd74b8680dba62c44f7e6d00d381ddb2d3c0.tar.gz
kernel-a609bd74b8680dba62c44f7e6d00d381ddb2d3c0.zip
ASoC: Intel: avs: Fix NULL ptr deref on rmmod
When uloading snd_soc_avs module there is NULL pointer dereference. It happens, because codec was moved into pdata and avs_component_hda_unregister_dais() was not updated. Fixes: 1581d5c68208 ("ASoC: Intel: avs: boards: Add Kconfig option for obsolete card names") Reviewed-by: Cezary Rojewski <[email protected]> Signed-off-by: Amadeusz Sławiński <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/intel/avs/pcm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index ccf90428126d..0efe490024b0 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -1570,11 +1570,13 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen
{
struct snd_soc_acpi_mach *mach;
struct snd_soc_dai *dai, *save;
+ struct avs_mach_pdata *pdata;
struct hda_codec *codec;
char name[32];
mach = dev_get_platdata(component->card->dev);
- codec = mach->pdata;
+ pdata = mach->pdata;
+ codec = pdata->codec;
snprintf(name, sizeof(name), "%s-cpu", dev_name(&codec->core.dev));
for_each_component_dais_safe(component, dai, save) {