Skip to content

Commit

Permalink
regmap: Fix kcalloc parameters swapped
Browse files Browse the repository at this point in the history
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Feb 10, 2012
1 parent 8a892d6 commit 2a14d7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 2a14d7d

Please sign in to comment.