From ed180abba7f1fc3cf04ffa27767b1bcc8e8c842a Mon Sep 17 00:00:00 2001 From: Amadeusz Sławiński Date: Mon, 13 May 2019 11:18:01 +0200 Subject: ALSA: hda: Fix race between creating and refreshing sysfs entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hda_widget_sysfs_reinit() can free underlying codec->widgets structure on which widget_tree_create() operates. Add locking to prevent such issues from happening. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110382 Signed-off-by: Amadeusz Sławiński Signed-off-by: Takashi Iwai --- include/sound/hdaudio.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h index ca1d9a70d026..5a9315af2d37 100644 --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h @@ -81,6 +81,7 @@ struct hdac_device { atomic_t in_pm; /* suspend/resume being performed */ /* sysfs */ + struct mutex widget_lock; struct hdac_widget_tree *widgets; /* regmap */ -- cgit v1.2.3-58-ga151