The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=992f5b16afa73d0ea63c8a886a78ad2eda928e37

commit 992f5b16afa73d0ea63c8a886a78ad2eda928e37
Author:     John Baldwin <[email protected]>
AuthorDate: 2024-02-16 00:05:09 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2024-02-16 00:05:09 +0000

    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
---
 sys/dev/pci/pci_host_generic.c | 1 +
 1 file changed, 1 insertion(+)

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;
                }
        }

Reply via email to