summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/regmap/regcache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 0852c890b4b..726d956f6a2 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -61,8 +61,8 @@ static int regcache_hw_init(struct regmap *map)
if (!regmap_volatile(map, i * map->reg_stride))
count++;
- map->reg_defaults = kmalloc(count * sizeof(struct reg_default),
- GFP_KERNEL);
+ map->reg_defaults = kmalloc_array(count, sizeof(struct reg_default),
+ GFP_KERNEL);
if (!map->reg_defaults) {
ret = -ENOMEM;
goto err_free;