Skip to content

Commit

Permalink
WMI: initialize wmi_blocks.list even if ACPI is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds committed Feb 12, 2008
1 parent 2c15826 commit 96b5a46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,11 @@ static int __init acpi_wmi_init(void)
{
acpi_status result;

INIT_LIST_HEAD(&wmi_blocks.list);

if (acpi_disabled)
return -ENODEV;

INIT_LIST_HEAD(&wmi_blocks.list);

result = acpi_bus_register_driver(&acpi_wmi_driver);

if (result < 0) {
Expand Down

0 comments on commit 96b5a46

Please sign in to comment.