Merge 926a8e73ebee06df8ed4ddaa695ad15e7a4aeeff on remote branch
Change-Id: Ic56d08d4ff1ba6847f944c64ef6d34a36f8736ac
diff --git a/snd_parser/src/snd-card-parser.c b/snd_parser/src/snd-card-parser.c
index 525028d..c31f8f0 100644
--- a/snd_parser/src/snd-card-parser.c
+++ b/snd_parser/src/snd-card-parser.c
@@ -653,8 +653,10 @@
list_for_each_safe(dev_node, temp, devs_list)
num_devs++;
- if (num_nodes > num_devs)
+ if (num_nodes > num_devs) {
+ pthread_rwlock_unlock(&snd_rwlock);
return -EINVAL;
+ }
list_for_each_safe(dev_node, temp, devs_list) {
dev_def = node_to_item(dev_node, struct snd_dev_def, list_node);