Skip to content

Commit 6c6fa26

Browse files
soyersoyertiwai
authored andcommitted
ALSA: hda/tas2781: call cleanup functions only once
If the module can load the RCA but not the firmware binary, it will call the cleanup functions. Then unloading the module causes general protection fault due to double free. Do not call the cleanup functions in tasdev_fw_ready. general protection fault, probably for non-canonical address 0x6f2b8a2bff4c8fec: 0000 [#1] PREEMPT SMP NOPTI Call Trace: <TASK> ? die_addr+0x36/0x90 ? exc_general_protection+0x1c5/0x430 ? asm_exc_general_protection+0x26/0x30 ? tasdevice_config_info_remove+0x6d/0xd0 [snd_soc_tas2781_fmwlib] tas2781_hda_unbind+0xaa/0x100 [snd_hda_scodec_tas2781_i2c] component_unbind+0x2e/0x50 component_unbind_all+0x92/0xa0 component_del+0xa8/0x140 tas2781_hda_remove.isra.0+0x32/0x60 [snd_hda_scodec_tas2781_i2c] i2c_device_remove+0x26/0xb0 Fixes: 5be27f1 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles <soyer@irl.hu> Link: https://lore.kernel.org/r/1a0885c424bb21172702d254655882b59ef6477a.1702510018.git.soyer@irl.hu Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 3307142 commit 6c6fa26

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

sound/pci/hda/tas2781_hda_i2c.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,6 @@ static void tasdev_fw_ready(const struct firmware *fmw, void *context)
550550
tas2781_save_calibration(tas_priv);
551551

552552
out:
553-
if (tas_priv->fw_state == TASDEVICE_DSP_FW_FAIL) {
554-
/*If DSP FW fail, kcontrol won't be created */
555-
tasdevice_config_info_remove(tas_priv);
556-
tasdevice_dsp_remove(tas_priv);
557-
}
558553
mutex_unlock(&tas_priv->codec_lock);
559554
if (fmw)
560555
release_firmware(fmw);

0 commit comments

Comments
 (0)