summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2023-03-24 23:26:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-30 14:57:48 +0300
commit066b90bca755f0b876e7b027b75d1796861d6db0 (patch)
tree8279a2a6563a73733517d97713b468754e5e3525 /drivers/acpi
parent7d8f5ccc826b39e05ff252b1fccd808c7a0725e0 (diff)
downloadlinux-066b90bca755f0b876e7b027b75d1796861d6db0.tar.xz
ACPI: EC: Fix oops when removing custom query handlers
[ Upstream commit e5b492c6bb900fcf9722e05f4a10924410e170c1 ] 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 <W_Armin@gmx.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 4707d1808ca5..487884420fb0 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1114,6 +1114,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);