Skip to content

Commit 3917330

Browse files
committed
ALSA: hda: Free card instance properly at probe errors
The recent change in hda-intel driver to allow repeated probes surfaced a problem that has been hidden until; the probe process in the work calls azx_free() at the error path, and this skips the card free process that eventually releases codec instances. As a result, we get a kernel WARNING like: snd_hda_intel 0000:00:1f.3: Cannot probe codecs, giving up ------------[ cut here ]------------ WARNING: CPU: 14 PID: 186 at sound/hda/hdac_bus.c:73 .... For fixing this, we need to call snd_card_free() instead of azx_free(). Additionally, the device drvdata has to be cleared, as the driver binding itself is still active. Then the PM and other driver callbacks will ignore the procedure. Fixes: c0f1886 ("ALSA: hda: intel: Allow repeatedly probing on codec configuration errors") Reported-and-tested-by: Scott Branden <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent c058493 commit 3917330

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/pci/hda/hda_intel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,8 @@ static int azx_probe_continue(struct azx *chip)
23272327

23282328
out_free:
23292329
if (err < 0) {
2330-
azx_free(chip);
2330+
pci_set_drvdata(pci, NULL);
2331+
snd_card_free(chip->card);
23312332
return err;
23322333
}
23332334

0 commit comments

Comments
 (0)