Commit c4775062d57c762de37ff93fb5f8611320c25e2a

Authored by Thomas Renninger
Committed by Matthew Garrett
1 parent 4519169b8f

hp-wmi: Fix mixing up of and/or directive

This should have been an "and". Additionally checking for !obj
is even better.

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: linux-acpi@vger.kernel.or
CC: platform-driver-x86@vger.kernel.org
CC: mjg@redhat.com
Signed-off-by: Matthew Garrett <mjg@redhat.com>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

drivers/platform/x86/hp-wmi.c
... ... @@ -434,7 +434,9 @@
434 434  
435 435 obj = (union acpi_object *)response.pointer;
436 436  
437   - if (obj || obj->type != ACPI_TYPE_BUFFER) {
  437 + if (!obj)
  438 + return;
  439 + if (obj->type != ACPI_TYPE_BUFFER) {
438 440 printk(KERN_INFO "hp-wmi: Unknown response received %d\n",
439 441 obj->type);
440 442 kfree(obj);