]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
platform/x86: huawei-wmi: Don't leak memory on the exit
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 10 Oct 2019 10:30:53 +0000 (13:30 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 15 Oct 2019 07:55:10 +0000 (10:55 +0300)
We have to clean memory resources allocated during init.

Fixes: 7532afb35012 ("platform/x86: huawei-wmi: Move to platform driver")
Cc: Ayman Bagabas <ayman.bagabas@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/huawei-wmi.c

index 3050444d53308ddd9132190b40f35aa2e0504de0..7ae9848cc6f3cc44d22f4af4a59e343fdb1655e6 100644 (file)
@@ -885,6 +885,8 @@ static __exit void huawei_wmi_exit(void)
 {
        platform_device_unregister(huawei_wmi->pdev);
        platform_driver_unregister(&huawei_wmi_driver);
+
+       kfree(huawei_wmi);
 }
 
 module_init(huawei_wmi_init);