diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2017-07-21 17:48:06 -0400 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2017-07-21 19:21:03 -0400 |
commit | 972777171f33f9932f51feebe42dbcc1b475d01a (patch) | |
tree | f7a8e1388bbfb9ee13f8e86c712917acb669e35b /drivers/platform/x86/wmi.c | |
parent | a00c69632a90a0e5ce195dd3115566772f237294 (diff) |
platform/x86: wmi: Fix error handling in acpi_wmi_init()
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>
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r-- | drivers/platform/x86/wmi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 1a764e311e11..e32ba575e8d9 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -1252,12 +1252,12 @@ static int __init acpi_wmi_init(void) | |||
1252 | 1252 | ||
1253 | return 0; | 1253 | return 0; |
1254 | 1254 | ||
1255 | err_unreg_class: | ||
1256 | class_unregister(&wmi_bus_class); | ||
1257 | |||
1258 | err_unreg_bus: | 1255 | err_unreg_bus: |
1259 | bus_unregister(&wmi_bus_type); | 1256 | bus_unregister(&wmi_bus_type); |
1260 | 1257 | ||
1258 | err_unreg_class: | ||
1259 | class_unregister(&wmi_bus_class); | ||
1260 | |||
1261 | return error; | 1261 | return error; |
1262 | } | 1262 | } |
1263 | 1263 | ||