diff options
Diffstat (limited to 'sound/core/vmaster.c')
-rw-r--r-- | sound/core/vmaster.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c index 9e96186742d0..40447395f0de 100644 --- a/sound/core/vmaster.c +++ b/sound/core/vmaster.c @@ -259,8 +259,8 @@ int _snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave, struct link_master *master_link = snd_kcontrol_chip(master); struct link_slave *srec; - srec = kzalloc(sizeof(*srec) + - slave->count * sizeof(*slave->vd), GFP_KERNEL); + srec = kzalloc(struct_size(srec, slave.vd, slave->count), + GFP_KERNEL); if (!srec) return -ENOMEM; srec->kctl = slave; |