summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-09-24 11:54:02 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-09-24 11:54:02 -0700
commitb95d667366cba716dfd69bfdb26e5a31c32f0c4b (patch)
treece7ef736051a570ad1dd7e6a89268436ea404fb6
parentfd84661ff957d61f5b1b3e84fb6553ee0c1584a4 (diff)
parentfaf60ba74f044e8cd61d0cd07aa94791d268654a (diff)
Merge "ALSA: info: Protect list access of new entry"
-rw-r--r--sound/core/info.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index 79dee33b5035..a04016c19f6d 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -754,8 +754,11 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent)
INIT_LIST_HEAD(&entry->children);
INIT_LIST_HEAD(&entry->list);
entry->parent = parent;
- if (parent)
+ if (parent) {
+ mutex_lock(&parent->access);
list_add_tail(&entry->list, &parent->children);
+ mutex_unlock(&parent->access);
+ }
return entry;
}