summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-03-12 16:57:51 +0100
committerTakashi Iwai <tiwai@suse.de>2015-03-13 07:21:51 +0100
commite79d74ab25339437447478e4dfe2b35c5b560512 (patch)
tree2eb582fd7f327b84dac46d96b769274c0b77bb24
parentMerge branch 'for-linus' into for-next (diff)
downloadlinux-e79d74ab25339437447478e4dfe2b35c5b560512.tar.xz
linux-e79d74ab25339437447478e4dfe2b35c5b560512.zip
ALSA: control: Fix breakage of user ctl element addition
In the commit [2225e79b9b03: 'ALSA: core: reduce stack usage related to snd_ctl_new()'], the id field of the newly added kctl is untouched, thus all attribute like name string remain empty. The fix is just to add the forgotten memcpy of the id field. Fixes: 2225e79b9b03 ('ALSA: core: reduce stack usage related to snd_ctl_new()') Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/core/control.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 54a412af3224..d677c27746e9 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1267,6 +1267,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
err = snd_ctl_new(&kctl, count, access, file);
if (err < 0)
return err;
+ memcpy(&kctl->id, &info->id, sizeof(kctl->id));
kctl->private_data = kzalloc(sizeof(struct user_element) + private_size,
GFP_KERNEL);
if (kctl->private_data == NULL) {