Check cpu_softc is not NULL before dereferencing
In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g. on arm64 when booting from FDT. Check it is not NULL at the start of the function so we don't try to dereference a NULL pointer. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
74237127e3
commit
4e50efb194
@ -444,6 +444,9 @@ acpi_cpu_postattach(void *unused __unused)
|
||||
struct acpi_cpu_softc *sc;
|
||||
int attached = 0, i;
|
||||
|
||||
if (cpu_softc == NULL)
|
||||
return;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
CPU_FOREACH(i) {
|
||||
if ((sc = cpu_softc[i]) != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user