ALSA: Fix initiailization of user-space controls
authorTakashi Iwai <tiwai@suse.de>
Mon, 8 Jan 2007 22:09:11 +0000 (23:09 +0100)
committerAdrian Bunk <bunk@stusta.de>
Tue, 9 Jan 2007 02:23:35 +0000 (03:23 +0100)
Fix an assertion when accessing a user-defined control due to lack of
initialization (appears only when CONFIG_SND_DEBUg is enabled).

  ALSA sound/core/control.c:660: BUG? (info->access == 0)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
sound/core/control.c

index 0c29679a8576b0dee6d913c5282f72d02fbd1d78..ebf68f1268598478ccc79fab462093b51e0aa5c7 100644 (file)
@@ -954,6 +954,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file,
        if (ue == NULL)
                return -ENOMEM;
        ue->info = *info;
+       ue->info.access = 0;
        ue->elem_data = (char *)ue + sizeof(*ue);
        ue->elem_data_size = private_size;
        kctl.private_free = snd_ctl_elem_user_free;