summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-01-07 13:11:03 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2018-01-19 22:35:58 -0500
commit59aeaf3fef9dcf59dc595390dd5b89dfedcb8926 (patch)
treecd1b9f5d30a24f9edc88ffd6a7c6740e3f5adb75 /sound/core
parent88a890375fa2fd9b54083979403243ab24a3ca35 (diff)
snd_ctl_elem_init_enum_names(): switch to vmemdup_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/control.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index eaef67bd004b..d16b53d0547c 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1198,7 +1198,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
if (ue->info.value.enumerated.names_length > 64 * 1024)
return -EINVAL;
- names = memdup_user((const void __user *)user_ptrval,
+ names = vmemdup_user((const void __user *)user_ptrval,
ue->info.value.enumerated.names_length);
if (IS_ERR(names))
return PTR_ERR(names);
@@ -1209,7 +1209,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
for (i = 0; i < ue->info.value.enumerated.items; ++i) {
name_len = strnlen(p, buf_len);
if (name_len == 0 || name_len >= 64 || name_len == buf_len) {
- kfree(names);
+ kvfree(names);
return -EINVAL;
}
p += name_len + 1;
@@ -1227,7 +1227,7 @@ static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol)
struct user_element *ue = kcontrol->private_data;
kvfree(ue->tlv_data);
- kfree(ue->priv_data);
+ kvfree(ue->priv_data);
kfree(ue);
}