mirror of https://github.com/torvalds/linux.git
The pci_bus_release_domain_nr() API is supposed to free the domain
number allocated by pci_bus_find_domain_nr(). Most of the callers of
pci_bus_find_domain_nr(), store the domain number in pci_bus::domain_nr.
As such, the pci_bus_release_domain_nr() implicitly frees the domain
number by dereferencing 'struct pci_bus'. However, one of the callers
of this API, the PCI endpoint subsystem, doesn't have 'struct pci_bus',
so it only passes NULL. Due to this, the API will end up dereferencing
the NULL pointer.
To fix this issue, pass the domain number to this API explicitly. Since
'struct pci_bus' is not used for anything else other than extracting the
domain number, it makes sense to pass the domain number directly.
Fixes:
|
||
|---|---|---|
| .. | ||
| functions | ||
| Kconfig | ||
| Makefile | ||
| pci-ep-cfs.c | ||
| pci-epc-core.c | ||
| pci-epc-mem.c | ||
| pci-epf-core.c | ||