Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60724d5c authored by Laxminath Kasam's avatar Laxminath Kasam
Browse files

ALSA: info: Protect list access of new entry



At bootup, two different contexts access same list
result in crash. Add mutex lock protect around list access.

CRs-Fixed: 2060390
Change-Id: I648db0a96c507c7e3ad9a5bb7d59021ebf86b27e
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent 5059309c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -735,8 +735,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;
}