git: 88f8e3c5ab97 - main - acpi_apei: Remove the hest member from the softc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 26 Dec 2025 15:43:50 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=88f8e3c5ab97025587d7df761c8ae72e2db6c1d3
commit 88f8e3c5ab97025587d7df761c8ae72e2db6c1d3
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-12-26 15:36:24 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-12-26 15:36:24 +0000
acpi_apei: Remove the hest member from the softc
This is only used during attach and freed after use, so just use a
local variable in the attach routine instead to avoid leaving a
dangling pointer around in the softc.
Reviewed by: imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D54310
---
sys/dev/acpica/acpi_apei.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c
index 0d23b504cb60..e85b3910e46d 100644
--- a/sys/dev/acpica/acpi_apei.c
+++ b/sys/dev/acpica/acpi_apei.c
@@ -86,7 +86,6 @@ struct apei_pges {
};
struct apei_softc {
- ACPI_TABLE_HEST *hest;
TAILQ_HEAD(, apei_ge) ges;
struct apei_nges nges;
struct apei_iges iges;
@@ -562,9 +561,8 @@ hest_parse_structure(struct apei_softc *sc, void *addr, int remaining)
}
static void
-hest_parse_table(struct apei_softc *sc)
+hest_parse_table(ACPI_TABLE_HEST *hest, struct apei_softc *sc)
{
- ACPI_TABLE_HEST *hest = sc->hest;
char *cp;
int remaining, consumed;
@@ -662,6 +660,7 @@ static int
apei_attach(device_t dev)
{
struct apei_softc *sc = device_get_softc(dev);
+ ACPI_TABLE_HEADER *hest;
struct acpi_softc *acpi_sc;
struct apei_pges *pges;
struct apei_ge *ge;
@@ -691,11 +690,11 @@ apei_attach(device_t dev)
}
/* Search and parse HEST table. */
- status = AcpiGetTable(ACPI_SIG_HEST, 0, (ACPI_TABLE_HEADER **)&sc->hest);
+ status = AcpiGetTable(ACPI_SIG_HEST, 0, &hest);
if (ACPI_FAILURE(status))
return (ENXIO);
- hest_parse_table(sc);
- AcpiPutTable((ACPI_TABLE_HEADER *)sc->hest);
+ hest_parse_table((ACPI_TABLE_HEST *)hest, sc);
+ AcpiPutTable(hest);
rid = 0;
TAILQ_FOREACH(ge, &sc->ges, link) {