summaryrefslogtreecommitdiff
path: root/sound/core/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 833b223a363a..54a412af3224 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1207,6 +1207,11 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
struct user_element *ue;
int err;
+ if (!*info->id.name)
+ return -EINVAL;
+ if (strnlen(info->id.name, sizeof(info->id.name)) >= sizeof(info->id.name))
+ return -EINVAL;
+
/* Delete a control to replace them if needed. */
if (replace) {
info->id.numid = 0;