diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/control.c | 6 |
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); } |