diff options
author | John Baldwin <jhb@FreeBSD.org> | 2024-02-16 00:05:09 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2024-02-16 00:05:09 +0000 |
commit | 992f5b16afa73d0ea63c8a886a78ad2eda928e37 (patch) | |
tree | 7f19c96a0b88af5a2412ab924ff95137d681bd59 | |
parent | e89d0785ff1332d234ae4382a849f3c23e23573a (diff) | |
download | src-992f5b16afa73d0ea63c8a886a78ad2eda928e37.tar.gz src-992f5b16afa73d0ea63c8a886a78ad2eda928e37.zip |
pci_host_generic: Set a valid error if allocating a range resource fails
Previously pci_host_generic_attach was returning 0 (success)
incorrectly if allocating a range failed. The error value was 0 from
the previously successful call to bus_set_resource in this case.
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
-rw-r--r-- | sys/dev/pci/pci_host_generic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 45a478634d20..ca384d9a1483 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -216,6 +216,7 @@ pci_host_generic_core_attach(device_t dev) if (sc->ranges[tuple].res == NULL) { device_printf(dev, "failed to allocate resource for range %d\n", tuple); + error = ENXIO; goto err_rman_manage; } } |