* [PATCH] ALSA: hda: Fix PCI connectivity check for parent buses
@ 2026-12-05 11:43 Sreeraj S Kurup
2026-12-05 12:16 ` Sreeraj S Kurup
0 siblings, 1 reply; 2+ messages in thread
From: Sreeraj S Kurup @ 2026-12-05 11:43 UTC (permalink / raw)
To: tiwai, perex; +Cc: linux-sound, linux-kernel, Sreeraj S Kurup
The connectivity_check() function checks whether the i915 GPU and
HD-audio controller are connected through the same PCI bus.
When checking their parent buses, both parent pointers can be NULL
if the devices are on different PCI root buses.
The current code compares these pointers before checking for NULL.
Since two NULL pointers are equal, the function incorrectly reports
that the devices are connected.
Move the NULL check before the parent bus comparison to prevent
this false positive.
Signed-off-by: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
---
sound/hda/core/i915.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/hda/core/i915.c b/sound/hda/core/i915.c
index 6c068b135b7d..1eed61ce65df 100644
--- a/sound/hda/core/i915.c
+++ b/sound/hda/core/i915.c
@@ -85,12 +85,12 @@ static bool connectivity_check(struct pci_dev *i915, struct pci_dev *hdac)
bus_b = bus_b->parent;
/* connected via parent bus (may be NULL!) */
- if (bus_a == bus_b)
- return true;
-
if (!bus_a || !bus_b)
return false;
+ if (bus_a == bus_b)
+ return true;
+
/*
* on i915 discrete GPUs with embedded HDA audio, the two
* devices are connected via 2nd level PCI bridge
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda: Fix PCI connectivity check for parent buses
2026-12-05 11:43 [PATCH] ALSA: hda: Fix PCI connectivity check for parent buses Sreeraj S Kurup
@ 2026-12-05 12:16 ` Sreeraj S Kurup
0 siblings, 0 replies; 2+ messages in thread
From: Sreeraj S Kurup @ 2026-12-05 12:16 UTC (permalink / raw)
To: sreekuttan2156239, perex, tiwai; +Cc: linux-kernel, linux-sound
Hi,
Thanks for the review. You're right.
Sashiko AI pointed out an issue in my patch.
The original NULL check order is needed for
Intel Arrow Lake systems.
Moving the NULL check before the bus comparison
could break display audio support.
I'll withdraw my patch and keep the original code.
Special thanks to Sashiko AI for catching this issue, and
thanks to the maintainers and everyone following this patch.
Best regards,
Sreeraj
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-05 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-05 11:43 [PATCH] ALSA: hda: Fix PCI connectivity check for parent buses Sreeraj S Kurup
2026-12-05 12:16 ` Sreeraj S Kurup
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®