diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2023-04-24 20:39:55 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2023-04-24 21:02:29 +0200 |
commit | 1129b226f7cd491c198b03d5048aaaa7262fdd42 (patch) | |
tree | dc5c1591ccfcf8f0d77493a670f7be35f736ee39 /target | |
parent | 60acbbb1af143779048bfb95252f33b400d309a5 (diff) | |
download | upstream-1129b226f7cd491c198b03d5048aaaa7262fdd42.tar.gz upstream-1129b226f7cd491c198b03d5048aaaa7262fdd42.tar.bz2 upstream-1129b226f7cd491c198b03d5048aaaa7262fdd42.zip |
kernel: ssb: fallback-sprom: check bustype
host_pci is only defined when bustype is SSB_BUSTYPE_PCI.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/ssb/fallback-sprom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/target/linux/generic/files/drivers/ssb/fallback-sprom.c b/target/linux/generic/files/drivers/ssb/fallback-sprom.c index 65436a42ec..26f0fd2f03 100644 --- a/target/linux/generic/files/drivers/ssb/fallback-sprom.c +++ b/target/linux/generic/files/drivers/ssb/fallback-sprom.c @@ -56,9 +56,14 @@ static struct list_head ssb_fbs_list = LIST_HEAD_INIT(ssb_fbs_list); int ssb_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out) { - const u32 pci_bus = bus->host_pci->bus->number; - const u32 pci_dev = PCI_SLOT(bus->host_pci->devfn); struct ssb_fbs *pos; + u32 pci_bus, pci_dev; + + if (bus->bustype != SSB_BUSTYPE_PCI) + return -ENOENT; + + pci_bus = bus->host_pci->bus->number; + pci_dev = PCI_SLOT(bus->host_pci->devfn); list_for_each_entry(pos, &ssb_fbs_list, list) { if (pos->pci_bus != pci_bus || |