CVE-2026-138882: wifi: mt76: mt7996: fix PCI device reference leak in mt7996_pci_init_hif2()
In the Linux kernel, the following vulnerability has been resolved:
wifi: mt76: mt7996: fix PCI device reference leak in mt7996pciinithif2()
pcigetdevice() increments the reference count on the returned struct pcidev. In mt7996pciinithif2(), three pcigetdevice() calls are made but their return values are only checked for NULL and then discarded. pcidevput() is never called, causing a PCI device reference count leak.
Fix this by storing the return value and calling pcidevput() before returning, following the same pattern already used in the sibling driver mt7915/pci.c.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In mt7996_pci_init_hif2(), store the return values of the three pci_get_device() calls and call pci_dev_put() on each returned struct pci_dev before returning.