Commit 4e50efb1 authored by Andrew Turner's avatar Andrew Turner
Browse files

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
parent 74237127
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment