Merge "ALSA: info: Protect list access of new entry"

This commit is contained in:
Linux Build Service Account 2017-09-24 11:54:02 -07:00 committed by Gerrit - the friendly Code Review server
commit b95d667366

View file

@ -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;
}