From 52237f3542b7f3dc1dfe22dd615a8a26b0296cdd Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 4 Sep 2002 07:35:25 +0000 Subject: [PATCH] Added back check for duplicated helements --- src/mixer/simple.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mixer/simple.c b/src/mixer/simple.c index e293517e..0f8ceba2 100644 --- a/src/mixer/simple.c +++ b/src/mixer/simple.c @@ -873,6 +873,15 @@ static int simple_add1(snd_mixer_class_t *class, const char *name, } else { simple = melem->private_data; } + if (simple->ctls[type].elem) { + SNDERR("helem (%s,'%s',%li,%li,%li) appears twice or more", + snd_ctl_elem_iface_name(snd_hctl_elem_get_interface(helem)), + snd_hctl_elem_get_name(helem), + snd_hctl_elem_get_index(helem), + snd_hctl_elem_get_device(helem), + snd_hctl_elem_get_subdevice(helem)); + return -EINVAL; + } simple->ctls[type].elem = helem; simple->ctls[type].type = info.type; simple->ctls[type].access = info.access; -- 2.47.1