Skip to content

Commit a609bd7

Browse files
Amadeusz Sławińskibroonie
authored andcommitted
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: 1581d5c ("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]>
1 parent 6f80be5 commit a609bd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/intel/avs/pcm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,11 +1570,13 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen
15701570
{
15711571
struct snd_soc_acpi_mach *mach;
15721572
struct snd_soc_dai *dai, *save;
1573+
struct avs_mach_pdata *pdata;
15731574
struct hda_codec *codec;
15741575
char name[32];
15751576

15761577
mach = dev_get_platdata(component->card->dev);
1577-
codec = mach->pdata;
1578+
pdata = mach->pdata;
1579+
codec = pdata->codec;
15781580
snprintf(name, sizeof(name), "%s-cpu", dev_name(&codec->core.dev));
15791581

15801582
for_each_component_dais_safe(component, dai, save) {

0 commit comments

Comments
 (0)