summaryrefslogtreecommitdiffstats
path: root/drivers/misc/vexpress-syscfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/vexpress-syscfg.c')
-rw-r--r--drivers/misc/vexpress-syscfg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c
index 9eea30f54fd6..80a6f199077c 100644
--- a/drivers/misc/vexpress-syscfg.c
+++ b/drivers/misc/vexpress-syscfg.c
@@ -182,8 +182,7 @@ static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
val = energy_quirk;
}
- func = kzalloc(sizeof(*func) + sizeof(*func->template) * num,
- GFP_KERNEL);
+ func = kzalloc(struct_size(func, template, num), GFP_KERNEL);
if (!func)
return ERR_PTR(-ENOMEM);