All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: wmi: Fix error handling in acpi_wmi_init()
@ 2017-07-21 21:48 Alexey Khoroshilov
  2017-07-21 23:43 ` Darren Hart
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Khoroshilov @ 2017-07-21 21:48 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Alexey Khoroshilov, platform-driver-x86, linux-kernel, ldv-project

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>
---
 drivers/platform/x86/wmi.c | 6 +++---
 1 file 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)
 
 	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;
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: wmi: Fix error handling in acpi_wmi_init()
  2017-07-21 21:48 [PATCH] platform/x86: wmi: Fix error handling in acpi_wmi_init() Alexey Khoroshilov
@ 2017-07-21 23:43 ` Darren Hart
  0 siblings, 0 replies; 2+ messages in thread
From: Darren Hart @ 2017-07-21 23:43 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Andy Shevchenko, platform-driver-x86, linux-kernel, ldv-project

On Sat, Jul 22, 2017 at 12:48:06AM +0300, Alexey Khoroshilov wrote:
> 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>

Eeek. Thank you. Applied to fixes for 4.13.X.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-21 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21 21:48 [PATCH] platform/x86: wmi: Fix error handling in acpi_wmi_init() Alexey Khoroshilov
2017-07-21 23:43 ` Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.