Browse Source

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 <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin 13 years ago
parent
commit
2a14d7d9b7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/base/regmap/regmap.c

+ 1 - 1
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) {
 	if (map->patch != NULL) {
 		memcpy(map->patch, regs,
 		memcpy(map->patch, regs,
 		       num_regs * sizeof(struct reg_default));
 		       num_regs * sizeof(struct reg_default));