]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/soc/soc-dapm.c
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / sound / soc / soc-dapm.c
index 36a39ba30226065acce41f10f639437950da29fd..255cad43a972119622d5eb1cb2b3bf9e151ac06e 100644 (file)
@@ -1086,7 +1086,7 @@ static int dapm_widget_list_create(struct snd_soc_dapm_widget_list **list,
        list_for_each(it, widgets)
                size++;
 
-       *list = kzalloc(sizeof(**list) + size * sizeof(*w), GFP_KERNEL);
+       *list = kzalloc(struct_size(*list, widgets, size), GFP_KERNEL);
        if (*list == NULL)
                return -ENOMEM;