Skip to content

Commit

Permalink
platform/x86: wmi: Fix error handling in acpi_wmi_init()
Browse files Browse the repository at this point in the history
The order of resource deallocations is messed up in acpi_wmi_init().
It should be vice versa.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
  • Loading branch information
Alexey Khoroshilov authored and Darren Hart (VMware) committed Jul 21, 2017
1 parent a00c696 commit 9727771
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,12 +1252,12 @@ static int __init acpi_wmi_init(void)

return 0;

err_unreg_class:
class_unregister(&wmi_bus_class);

err_unreg_bus:
bus_unregister(&wmi_bus_type);

err_unreg_class:
class_unregister(&wmi_bus_class);

return error;
}

Expand Down

0 comments on commit 9727771

Please sign in to comment.