Skip to content

Commit 87c9e7d

Browse files
AlbanBedeltiwai
authored andcommitted
ALSA: azt3328 - Fix NULL ptr dereference on cards without OPL3
opl3->private_data was set even if opl3 could not be created. Signed-off-by: Alban Bedel <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 068b939 commit 87c9e7d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sound/pci/azt3328.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,10 +2684,9 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
26842684
err = snd_opl3_hwdep_new(opl3, 0, 1, NULL);
26852685
if (err < 0)
26862686
goto out_err;
2687+
opl3->private_data = chip;
26872688
}
26882689

2689-
opl3->private_data = chip;
2690-
26912690
sprintf(card->longname, "%s at 0x%lx, irq %i",
26922691
card->shortname, chip->ctrl_io, chip->irq);
26932692

0 commit comments

Comments
 (0)