This makes acpi_loadtables() ensure that rsdp->rsdp_rsdt exists before
attempting to to use it.

ok?


Index: acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.365
diff -u -p -r1.365 acpi.c
--- acpi.c      11 May 2019 14:59:52 -0000      1.365
+++ acpi.c      12 May 2019 01:36:26 -0000
@@ -1363,7 +1363,7 @@ acpi_loadtables(struct acpi_softc *sc, s
                            NULL, 1);
 
                free(sdt, M_DEVBUF, sizeof(*sdt) + len);
-       } else {
+       } else if (rsdp->rsdp_rsdt) {
                struct acpi_rsdt *rsdt;
 
                sdt = acpi_maptable(sc, rsdp->rsdp_rsdt, NULL, NULL, NULL, 0);
@@ -1382,6 +1382,9 @@ acpi_loadtables(struct acpi_softc *sc, s
                            NULL, 1);
 
                free(sdt, M_DEVBUF, sizeof(*sdt) + len);
+       } else {
+               printf("couldn't find xsdt or rsdt\n");
+               return (ENOMEM);
        }
 
        return (0);

Reply via email to