Add NULL check for the output buffer from AcpiEvaluateObject().
Submitted by: jon
This commit is contained in:
parent
786c276fe4
commit
3c24196d00
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100539
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user