From e8f8dbdb390ea112fa13a0d369a4bcfc34174cde Mon Sep 17 00:00:00 2001 From: allanjude Date: Sat, 13 Jun 2015 05:55:26 +0000 Subject: [PATCH] acpi_ibm.ko panics if SMBIOS information is not available Add a check for NULL before strcmp on smbios information incase it is not populated Differential Revision: https://reviews.freebsd.org/D2750 Reviewed by: ngie, jhb Approved by: rpaulo Sponsored by: ScaleEngine Inc. --- sys/dev/acpi_support/acpi_ibm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c index 11636815c318..f8ff1ebca347 100644 --- a/sys/dev/acpi_support/acpi_ibm.c +++ b/sys/dev/acpi_support/acpi_ibm.c @@ -485,6 +485,9 @@ acpi_ibm_attach(device_t dev) /* Enable per-model events. */ maker = kern_getenv("smbios.system.maker"); product = kern_getenv("smbios.system.product"); + if (maker != NULL && product != NULL) + goto nosmbios; + for (i = 0; i < nitems(acpi_ibm_models); i++) { if (strcmp(maker, acpi_ibm_models[i].maker) == 0 && strcmp(product, acpi_ibm_models[i].product) == 0) { @@ -494,6 +497,8 @@ acpi_ibm_attach(device_t dev) ACPI_SERIAL_END(ibm); } } + +nosmbios: freeenv(maker); freeenv(product);