summaryrefslogtreecommitdiffstats
path: root/sound/core/vmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/vmaster.c')
-rw-r--r--sound/core/vmaster.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/vmaster.c b/sound/core/vmaster.c
index 58fa3f94722a..fd99d8abe2af 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;