mirror of
https://github.com/torvalds/linux.git
synced 2026-09-26 18:12:03 +02:00
platform/x86: dell-privacy: Fix race condition
Accessing priv->features_present needs to happen with the list mutex
being held, otherwise priv can be freed at any moment.
Fixes: 8af9fa37b8 ("platform/x86: dell-privacy: Add support for Dell hardware privacy")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260612173451.467629-2-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>
This commit is contained in:
parent
dcabd63cd1
commit
ca9338dbc6
|
|
@ -92,11 +92,11 @@ bool dell_privacy_has_mic_mute(void)
|
|||
{
|
||||
struct privacy_wmi_data *priv;
|
||||
|
||||
mutex_lock(&list_mutex);
|
||||
guard(mutex)(&list_mutex);
|
||||
|
||||
priv = list_first_entry_or_null(&wmi_list,
|
||||
struct privacy_wmi_data,
|
||||
list);
|
||||
mutex_unlock(&list_mutex);
|
||||
|
||||
return priv && (priv->features_present & BIT(DELL_PRIVACY_TYPE_AUDIO));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user