ALSA: vmaster: Zero-clear ctl before calling slave get
authorTakashi Iwai <tiwai@suse.de>
Thu, 8 Mar 2018 07:32:41 +0000 (08:32 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 Mar 2018 07:41:13 +0000 (08:41 +0100)
Use kzalloc() instead of kmalloc() so that we don't need to rely fully
on the slave get() callback to clear the control value that might be
copied to user-space.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/vmaster.c

index b67de2b..9e96186 100644 (file)
@@ -63,7 +63,7 @@ static int slave_update(struct link_slave *slave)
        struct snd_ctl_elem_value *uctl;
        int err, ch;
 
-       uctl = kmalloc(sizeof(*uctl), GFP_KERNEL);
+       uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
        if (!uctl)
                return -ENOMEM;
        uctl->id = slave->slave.id;