Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
[linux-2.6-block.git] / drivers / reset / core.c
index 6488292e129c24921cc56e66e9b896d36f39540c..225e34c56b94a2e315f17a598bd7a74d6dae1932 100644 (file)
@@ -730,8 +730,7 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)
        if (num < 0)
                return optional ? NULL : ERR_PTR(num);
 
-       resets = kzalloc(sizeof(*resets) + sizeof(resets->rstc[0]) * num,
-                        GFP_KERNEL);
+       resets = kzalloc(struct_size(resets, rstc, num), GFP_KERNEL);
        if (!resets)
                return ERR_PTR(-ENOMEM);