[PATCH] regmap: Fix kcalloc parameters swapped

From: Axel Lin
Date: Fri Feb 10 2012 - 06:30:07 EST


The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
---
drivers/base/regmap/regmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index f9cdaf3..11d54e7 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -785,7 +785,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));
--
1.7.5.4



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/