Commit 96b5a46e2a72dc1829370c87053e0cd558d58bc0

Authored by Linus Torvalds
1 parent 2c15826998

WMI: initialize wmi_blocks.list even if ACPI is disabled

Even if we don't want to register the WMI driver, we should initialize
the wmi_blocks list to be empty, since we don't want the wmi helper
functions to oops just because that basic list has not even been set up.

With this, "find_guid()" will happily return "not found" rather than
oopsing all over the place, and the callers will then just automatically
return false or AE_NOT_FOUND as appropriate.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

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

... ... @@ -673,10 +673,10 @@
673 673 {
674 674 acpi_status result;
675 675  
  676 + INIT_LIST_HEAD(&wmi_blocks.list);
  677 +
676 678 if (acpi_disabled)
677 679 return -ENODEV;
678   -
679   - INIT_LIST_HEAD(&wmi_blocks.list);
680 680  
681 681 result = acpi_bus_register_driver(&acpi_wmi_driver);
682 682