acpi_hp(4): Fix some previously overlooked issues.
authorSascha Wildner <saw@online.de>
Sun, 8 Apr 2012 22:29:44 +0000 (00:29 +0200)
committerSascha Wildner <saw@online.de>
Sun, 8 Apr 2012 22:29:44 +0000 (00:29 +0200)
sys/dev/acpica5/acpi_hp/acpi_hp.c

index 0c6bffe..0ba8948 100644 (file)
@@ -821,7 +821,7 @@ acpi_hp_notify(ACPI_HANDLE h, UINT32 notify, void *context)
        ACPI_OBJECT *obj;
        ACPI_WMI_GET_EVENT_DATA(sc->wmi_dev, notify, &response);
        obj = (ACPI_OBJECT*) response.Pointer;
-       if (!obj || obj->Type != ACPI_TYPE_PACKAGE) {
+       if (obj && obj->Type == ACPI_TYPE_BUFFER && obj->Buffer.Length == 8) {
                if (*((UINT8 *) obj->Buffer.Pointer) == 0x5) {
                        acpi_hp_evaluate_auto_on_off(sc);
                }
@@ -920,7 +920,7 @@ acpi_hp_get_cmi_block(device_t wmi_dev, const char* guid, UINT8 instance,
                return (-EINVAL);
        }
        obj = out.Pointer;
-       if (!obj && obj->Type != ACPI_TYPE_PACKAGE) {
+       if (!obj || obj->Type != ACPI_TYPE_PACKAGE) {
                acpi_hp_free_buffer(&out);
                return (-EINVAL);
        }