Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2025 14:17:00 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c8e37e38080d - stable/14 - pci_host_generic: Set a valid error if allocating a range resource fails
Message-ID:  <202502271417.51REH02i016564@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by jhb:

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

commit c8e37e38080dac3287578ab05d4d8e28046a2493
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-02-16 00:05:09 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-02-27 13:09:21 +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
    (cherry picked from commit 992f5b16afa73d0ea63c8a886a78ad2eda928e37)
---
 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;
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502271417.51REH02i016564>