summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache-lzo.c
diff options
context:
space:
mode:
authorlixiubo <lixiubo@cmss.chinamobile.com>2015-11-20 18:06:30 +0800
committerMark Brown <broonie@kernel.org>2015-11-20 12:27:59 +0000
commit549e08a0a93442ab62e0aee8aeb8ae6a7f2b5273 (patch)
tree9bf090c5b8126d10c939fbc3ed8070858d22c951 /drivers/base/regmap/regcache-lzo.c
parenteeda1bd69d5d8a020ce191f717b94ca99707daad (diff)
downloadlinux-549e08a0a93442ab62e0aee8aeb8ae6a7f2b5273.tar.bz2
regmap: replace kmalloc with kmalloc_array
Replace kmalloc with specialized function kmalloc_array when the size is a multiplication of : number * size Signed-off-by: lixiubo <lixiubo@cmss.chinamobile.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap/regcache-lzo.c')
-rw-r--r--drivers/base/regmap/regcache-lzo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/regmap/regcache-lzo.c b/drivers/base/regmap/regcache-lzo.c
index 52f69381c070..6f77d7319fc6 100644
--- a/drivers/base/regmap/regcache-lzo.c
+++ b/drivers/base/regmap/regcache-lzo.c
@@ -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;