@@ -2150,7 +2150,7 @@ static int azx_probe(struct pci_dev *pci,
err = register_vga_switcheroo(chip);
if (err < 0) {
dev_err(card->dev, "Error registering vga_switcheroo client\n");
- goto out_free;
+ goto out_azx_free;
}
if (check_hdmi_disabled(pci)) {
@@ -2169,7 +2169,7 @@ static int azx_probe(struct pci_dev *pci,
&pci->dev, GFP_KERNEL, card,
azx_firmware_cb);
if (err < 0)
- goto out_free;
+ goto out_azx_free;
schedule_probe = false; /* continued in azx_firmware_cb() */
}
#endif /* CONFIG_SND_HDA_PATCH_LOADER */
@@ -2187,6 +2187,9 @@ static int azx_probe(struct pci_dev *pci,
complete_all(&hda->probe_wait);
return 0;
+out_azx_free:
+ azx_free(chip);
+ pci_set_drvdata(pci, NULL);
out_free:
snd_card_free(card);
return err;