The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b230a7b9a52c0fc948f4f1dcd1225a94674073f6
commit b230a7b9a52c0fc948f4f1dcd1225a94674073f6 Author: Kyle Evans <[email protected]> AuthorDate: 2026-05-09 02:42:50 +0000 Commit: Kyle Evans <[email protected]> CommitDate: 2026-06-04 05:14:42 +0000 kern: ofw: provide ofw_bus_destroy_iinfo to teardown interrupt-map For symmetry with ofw_bus_setup_iinfo, the next commits will use it to properly cleanup on failure in bcm2838_pci. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D56895 --- sys/dev/ofw/ofw_bus_subr.c | 12 ++++++++++++ sys/dev/ofw/ofw_bus_subr.h | 1 + 2 files changed, 13 insertions(+) diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c index efca3ea14e2f..e4779ff74e48 100644 --- a/sys/dev/ofw/ofw_bus_subr.c +++ b/sys/dev/ofw/ofw_bus_subr.c @@ -358,6 +358,18 @@ ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz) } } +void +ofw_bus_destroy_iinfo(struct ofw_bus_iinfo *ii) +{ + + if (ii->opi_imapsz > 0) { + OF_prop_free(ii->opi_imapmsk); + ii->opi_imapsz = 0; + } + + OF_prop_free(ii->opi_imap); +} + int ofw_bus_lookup_imap(phandle_t node, struct ofw_bus_iinfo *ii, void *reg, int regsz, void *pintr, int pintrsz, void *mintr, int mintrsz, diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h index 203c9689f156..89732f5570a7 100644 --- a/sys/dev/ofw/ofw_bus_subr.h +++ b/sys/dev/ofw/ofw_bus_subr.h @@ -86,6 +86,7 @@ bus_get_device_path_t ofw_bus_gen_get_device_path; /* Routines for processing firmware interrupt maps */ void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); +void ofw_bus_destroy_iinfo(struct ofw_bus_iinfo *); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, void *, int, void *, int, phandle_t *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *,
