diff options
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/control.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index abd62f943726..0c29679a8576 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -959,17 +959,15 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, | |||
959 | kctl.private_free = snd_ctl_elem_user_free; | 959 | kctl.private_free = snd_ctl_elem_user_free; |
960 | _kctl = snd_ctl_new(&kctl, access); | 960 | _kctl = snd_ctl_new(&kctl, access); |
961 | if (_kctl == NULL) { | 961 | if (_kctl == NULL) { |
962 | kfree(_kctl->private_data); | 962 | kfree(ue); |
963 | return -ENOMEM; | 963 | return -ENOMEM; |
964 | } | 964 | } |
965 | _kctl->private_data = ue; | 965 | _kctl->private_data = ue; |
966 | for (idx = 0; idx < _kctl->count; idx++) | 966 | for (idx = 0; idx < _kctl->count; idx++) |
967 | _kctl->vd[idx].owner = file; | 967 | _kctl->vd[idx].owner = file; |
968 | err = snd_ctl_add(card, _kctl); | 968 | err = snd_ctl_add(card, _kctl); |
969 | if (err < 0) { | 969 | if (err < 0) |
970 | snd_ctl_free_one(_kctl); | ||
971 | return err; | 970 | return err; |
972 | } | ||
973 | 971 | ||
974 | down_write(&card->controls_rwsem); | 972 | down_write(&card->controls_rwsem); |
975 | card->user_ctl_count++; | 973 | card->user_ctl_count++; |