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:		d79b6b8ec2 pci_host_generic: Don't rewrite resource start address for translation
This commit is contained in:
John Baldwin
2024-02-15 16:05:09 -08:00
parent e89d0785ff
commit 992f5b16af
+1
View File
@@ -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;
}
}