]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/platform/x86/thinkpad_acpi.c
thinkpad_acpi: Free hotkey_keycode_map after unregistering tpacpi_inputdev
[karo-tx-linux.git] / drivers / platform / x86 / thinkpad_acpi.c
index ae203558ac9022f5a442b11cf0bbeab4dc93a86b..e7f73287636cd9bdabb3f0b32104d4b7257e5e69 100644 (file)
@@ -3015,8 +3015,6 @@ static void hotkey_exit(void)
        if (hotkey_dev_attributes)
                delete_attr_set(hotkey_dev_attributes, &tpacpi_pdev->dev.kobj);
 
-       kfree(hotkey_keycode_map);
-
        dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY,
                   "restoring original HKEY status and mask\n");
        /* yes, there is a bitwise or below, we want the
@@ -8937,6 +8935,7 @@ static void thinkpad_acpi_module_exit(void)
                        input_unregister_device(tpacpi_inputdev);
                else
                        input_free_device(tpacpi_inputdev);
+               kfree(hotkey_keycode_map);
        }
 
        if (tpacpi_hwmon)