]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: wmi: Fix error handling in legacy WMI notify handler functions
authorArmin Wolf <W_Armin@gmx.de>
Wed, 3 Jan 2024 19:27:04 +0000 (20:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:21:19 +0000 (16:21 -0800)
commit549b755efa423ca73ba21cbb8eff89a06c30250a
tree954a62f4c5971a10efed75a3035d3b08d694b28c
parent26ef46b731576387fa56e9aafb6ccb75cf1d6cfd
platform/x86: wmi: Fix error handling in legacy WMI notify handler functions

[ Upstream commit 6ba7843b59b77360812617d071313c7f35f3757a ]

When wmi_install_notify_handler()/wmi_remove_notify_handler() are
unable to enable/disable the WMI device, they unconditionally return
an error to the caller.
When registering legacy WMI notify handlers, this means that the
callback remains registered despite wmi_install_notify_handler()
having returned an error.
When removing legacy WMI notify handlers, this means that the
callback is removed despite wmi_remove_notify_handler() having
returned an error.

Fix this by only warning when the WMI device could not be enabled.
This behaviour matches the bus-based WMI interface.

Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.

Fixes: 58f6425eb92f ("WMI: Cater for multiple events with same GUID")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240103192707.115512-2-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/wmi.c