Skip to contentSkip to conversation

ALSA: vx222: fix null-ptr-deref

PATCH Applied Tong Zhang 2 participants 2 messages Sep 7, 2021 – Sep 9, 2021 Sound

lore
Share & tools
lore

Tong Zhang

author
#0 lore raw

PATCH 1/1 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 3bde3359aa16 ("ALSA: vx222: Allocate resources with device-managed APIs")
---
 sound/pci/vx222/vx222.c | 1 +
 1 file changed, 1 insertion(+)
sound/pci/vx222/vx222.c +1 -0
index f48cc20b9e8a..468a6a20dc1e 100644
@@ -137,6 +137,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
 	}
 	chip->irq = pci->irq;
 	card->sync_irq = chip->irq;
+	*rchip = vx;
 
 	return 0;
 }
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 11 lines · Tong Zhang

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 3bde3359aa16 ("ALSA: vx222: Allocate resources with device-managed APIs")

Thanks, applied.

Takashi