Skip to content

Commit 8491f59

Browse files
lztotiwai
authored andcommitted
ALSA: vx222: fix null-ptr-deref
a recent refactor created a null pointer vx in snd_vx222_probe(). The vx pointer should have been populated in snd_vx222_create() as suggested in earlier version, otherwise vx->core.ibl.size will throw an error. [ 1.298398] BUG: kernel NULL pointer dereference, address: 00000000000001d8 [ 1.316799] RIP: 0010:snd_vx222_probe+0x155/0x290 [snd_vx222] Fixes: 3bde335 ("ALSA: vx222: Allocate resources with device-managed APIs") Signed-off-by: Tong Zhang <ztong0001@gmail.com> Link: https://lore.kernel.org/r/20210907014746.1445278-1-ztong0001@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c8b177b commit 8491f59

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sound/pci/vx222/vx222.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
137137
}
138138
chip->irq = pci->irq;
139139
card->sync_irq = chip->irq;
140+
*rchip = vx;
140141

141142
return 0;
142143
}

0 commit comments

Comments
 (0)