platform/x86: wmi: Fix refcounting of WMI devices in legacy functions
authorArmin Wolf <W_Armin@gmx.de>
Fri, 20 Oct 2023 21:10:02 +0000 (23:10 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 25 Oct 2023 09:46:36 +0000 (12:46 +0300)
commit7444f8347487df8d898fbc022249942806c80fc9
treeecfdb0045aba89851a7d0b908972f23d0267ba41
parent4186a47dbfbce2f97b0c025a7eac32bb5130df05
platform/x86: wmi: Fix refcounting of WMI devices in legacy functions

Until now, legacy GUID-based functions where using find_guid() when
searching for WMI devices, which did no refcounting on the returned
WMI device. This meant that the WMI device could disappear at any
moment, potentially leading to various errors. Fix this by using
bus_find_device() which returns an actual reference to the found
WMI device.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20231020211005.38216-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/wmi.c