From 3c24196d00dd5645fd7f31f8884e4c4ddd4e3d75 Mon Sep 17 00:00:00 2001 From: Mitsuru IWASAKI Date: Tue, 23 Jul 2002 00:47:13 +0000 Subject: [PATCH] Add NULL check for the output buffer from AcpiEvaluateObject(). Submitted by: jon --- sys/dev/acpica/acpi_cmbat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index 952bc78e7a28..0c200bd326c0 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -193,7 +193,7 @@ acpi_cmbat_get_bst(void *context) res = (ACPI_OBJECT *)bst_buffer.Pointer; - if ((res->Type != ACPI_TYPE_PACKAGE) || (res->Package.Count != 4)) { + if ((res == NULL) || (res->Type != ACPI_TYPE_PACKAGE) || (res->Package.Count != 4)) { ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), "battery status corrupted\n"); goto end; @@ -244,7 +244,7 @@ acpi_cmbat_get_bif(void *context) res = (ACPI_OBJECT *)bif_buffer.Pointer; - if ((res->Type != ACPI_TYPE_PACKAGE) || (res->Package.Count != 13)) { + if ((res == NULL) || (res->Type != ACPI_TYPE_PACKAGE) || (res->Package.Count != 13)) { ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), "battery info corrupted\n"); goto end;