Skip to contentSkip to conversation

ALSA: core: Fix SSID quirk lookup for subvendor=0

PATCH Superseded Takashi Iwai 1 participant 2 messages Jan 15, 2022 – Jan 16, 2022 Sound

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: core: Fix SSID quirk lookup for subvendor=0

Some weird devices set the codec SSID vendor ID 0, and snd_pci_quirk_lookup_id() loop aborts at the point although it should still try matching with the SSID device ID. This resulted in a missing quirk for some old Macs.

Fix the loop termination condition to check both subvendor and subdevice.

Fixes 73355ddd8775 ("ALSA: hda: Code refactoring snd_hda_pick_fixup()")
---
 sound/core/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/misc.c +1 -1
index 3579dd7a161f..a512c849a9e5 100644
@@ -112,7 +112,7 @@ snd_pci_quirk_lookup_id(u16 vendor, u16 device,
 {
 	const struct snd_pci_quirk *q;
 
-	for (q = list; q->subvendor; q++) {
+	for (q = list; q->subvendor && q->subdevice; q++) {
 		if (q->subvendor != vendor)
 			continue;
 		if (!q->subdevice ||
Signature · 1 line
2.31.1
#1 lore raw
Quoted 22 lines · Takashi Iwai

Some weird devices set the codec SSID vendor ID 0, and snd_pci_quirk_lookup_id() loop aborts at the point although it should still try matching with the SSID device ID. This resulted in a missing quirk for some old Macs.

Fix the loop termination condition to check both subvendor and subdevice.

Fixes 73355ddd8775 ("ALSA: hda: Code refactoring snd_hda_pick_fixup()")
---
 sound/core/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/misc.c +0 -0
index 3579dd7a161f..a512c849a9e5 100644

sound/core/misc.c snd_pci_quirk_lookup_id(u16 vendor, u16 device, · line 115

Quoted 5 lines
sound/core/misc.c +1 -1
@@ -112,7 +112,7 @@ snd_pci_quirk_lookup_id(u16 vendor, u16 device,
 {
 	const struct snd_pci_quirk *q;
 
-	for (q = list; q->subvendor; q++) {
+	for (q = list; q->subvendor && q->subdevice; q++) {

Doh, a wrong version was sent out. It must be OR instead. Will resubmit v2.

Takashi