summaryrefslogtreecommitdiff
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-03-12 09:38:46 +0300
committerTakashi Iwai <tiwai@suse.de>2015-03-12 09:38:46 +0300
commite6826ef14597981f78156a0d5f9553b19f356e3f (patch)
tree30a19b996778016aefc2d47d5990f0c251d14a02 /sound/core/control.c
parent4945f1fdc14ef090abe50d1b5682bfc1e4763c06 (diff)
parentbe3bb8236db2d0fcd705062ae2e2a9d75131222f (diff)
downloadlinux-e6826ef14597981f78156a0d5f9553b19f356e3f.tar.xz
Merge branch 'for-linus' into for-next
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;