[PATCH v2] ALSA: hda/realtek: add missing NULL check for codec->bus->pci

From: songxiebing

Date: Wed Jul 29 2026 - 22:00:40 EST


From: Bob Song <songxiebing@xxxxxxxxxx>

In alc269_probe(), codec->bus->pci is dereferenced without a NULL check
for the ALC236 vendor ID case. Add the missing check, consistent with
the existing pattern used elsewhere in the same function.

Signed-off-by: Bob Song <songxiebing@xxxxxxxxxx>
---
v2:
- Separate processing of return values from reading COEF and
null pointer detection for device.
---
sound/hda/codecs/realtek/alc269.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 4645793b64ac..d751e39529a2 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -8849,6 +8849,7 @@ static int alc269_probe(struct hda_codec *codec, const struct hda_device_id *id)
spec->init_hook = alc256_init;
spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
if (codec->core.vendor_id == 0x10ec0236 &&
+ codec->bus->pci &&
codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
spec->en_3kpull_low = false;
break;
--
2.25.1