From: Armin Wolf Date: Fri, 24 Mar 2023 20:26:27 +0000 (+0100) Subject: ACPI: EC: Fix oops when removing custom query handlers X-Git-Tag: v6.4-rc1~149^2~2^4~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e5b492c6bb900fcf9722e05f4a10924410e170c1;p=tomoyo%2Ftomoyo-test1.git ACPI: EC: Fix oops when removing custom query handlers When removing custom query handlers, the handler might still be used inside the EC query workqueue, causing a kernel oops if the module holding the callback function was already unloaded. Fix this by flushing the EC query workqueue when removing custom query handlers. Tested on a Acer Travelmate 4002WLMi Signed-off-by: Armin Wolf Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 5ef72287d1be..928899ab9502 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1133,6 +1133,7 @@ static void acpi_ec_remove_query_handlers(struct acpi_ec *ec, void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) { acpi_ec_remove_query_handlers(ec, false, query_bit); + flush_workqueue(ec_query_wq); } EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);