Add NULL check for the output buffer from AcpiEvaluateObject().

Submitted by:	jon
This commit is contained in:
Mitsuru IWASAKI 2002-07-23 00:47:13 +00:00
parent 786c276fe4
commit 3c24196d00
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100539

View File

@ -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;