From: Axel Lin Date: Fri, 10 Feb 2012 11:29:55 +0000 (+0800) Subject: regmap: Fix kcalloc parameters swapped X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2a14d7d9b7439fe62082a60a7f8983ccb463d134;p=linux-beck.git regmap: Fix kcalloc parameters swapped The first parameter should be "number of elements" and the second parameter should be "element size". Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 28e89fd7c28d..46b2bd742ee6 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -709,7 +709,7 @@ int regmap_register_patch(struct regmap *map, const struct reg_default *regs, } } - map->patch = kcalloc(sizeof(struct reg_default), num_regs, GFP_KERNEL); + map->patch = kcalloc(num_regs, sizeof(struct reg_default), GFP_KERNEL); if (map->patch != NULL) { memcpy(map->patch, regs, num_regs * sizeof(struct reg_default));