]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/regmap/regcache-lzo.c
Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[karo-tx-linux.git] / drivers / base / regmap / regcache-lzo.c
index 736e0d378567c80900f2be8dd4d117b829e0242d..6f77d7319fc6dd35182fecefcaa56a4650fed65f 100644 (file)
@@ -139,7 +139,7 @@ static int regcache_lzo_init(struct regmap *map)
        ret = 0;
 
        blkcount = regcache_lzo_block_count(map);
-       map->cache = kzalloc(blkcount * sizeof *lzo_blocks,
+       map->cache = kcalloc(blkcount, sizeof(*lzo_blocks),
                             GFP_KERNEL);
        if (!map->cache)
                return -ENOMEM;
@@ -152,8 +152,8 @@ static int regcache_lzo_init(struct regmap *map)
         * that register.
         */
        bmp_size = map->num_reg_defaults_raw;
-       sync_bmp = kmalloc(BITS_TO_LONGS(bmp_size) * sizeof(long),
-                          GFP_KERNEL);
+       sync_bmp = kmalloc_array(BITS_TO_LONGS(bmp_size), sizeof(long),
+                                GFP_KERNEL);
        if (!sync_bmp) {
                ret = -ENOMEM;
                goto err;