diff options
author | allanjude <allanjude@FreeBSD.org> | 2015-06-13 05:55:26 +0000 |
---|---|---|
committer | allanjude <allanjude@FreeBSD.org> | 2015-06-13 05:55:26 +0000 |
commit | e8f8dbdb390ea112fa13a0d369a4bcfc34174cde (patch) | |
tree | 4a08a9da35ef608c7197da469a068b6edc2cccc3 | |
parent | 711a6b1e7a87fc7b5a76133da3356653c09bf0e2 (diff) | |
download | FreeBSD-src-e8f8dbdb390ea112fa13a0d369a4bcfc34174cde.zip FreeBSD-src-e8f8dbdb390ea112fa13a0d369a4bcfc34174cde.tar.gz |
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.
-rw-r--r-- | sys/dev/acpi_support/acpi_ibm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c index 1163681..f8ff1eb 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); |