Skip to content

Commit

Permalink
ALSA: vmaster: Zero-clear ctl before calling slave get
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed Mar 8, 2018
1 parent 2e2c177 commit 7a33a02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/vmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7a33a02

Please sign in to comment.