Loading drivers/base/regmap/regmap.c +8 −9 Original line number Original line Diff line number Diff line Loading @@ -1891,13 +1891,10 @@ EXPORT_SYMBOL_GPL(regmap_async_complete); int regmap_register_patch(struct regmap *map, const struct reg_default *regs, int regmap_register_patch(struct regmap *map, const struct reg_default *regs, int num_regs) int num_regs) { { struct reg_default *p; int i, ret; int i, ret; bool bypass; bool bypass; /* If needed the implementation can be extended to support this */ if (map->patch) return -EBUSY; map->lock(map->lock_arg); map->lock(map->lock_arg); bypass = map->cache_bypass; bypass = map->cache_bypass; Loading @@ -1914,11 +1911,13 @@ int regmap_register_patch(struct regmap *map, const struct reg_default *regs, } } } } map->patch = kcalloc(num_regs, sizeof(struct reg_default), GFP_KERNEL); p = krealloc(map->patch, if (map->patch != NULL) { sizeof(struct reg_default) * (map->patch_regs + num_regs), memcpy(map->patch, regs, GFP_KERNEL); num_regs * sizeof(struct reg_default)); if (p) { map->patch_regs = num_regs; memcpy(p + map->patch_regs, regs, num_regs * sizeof(*regs)); map->patch = p; map->patch_regs += num_regs; } else { } else { ret = -ENOMEM; ret = -ENOMEM; } } Loading Loading
drivers/base/regmap/regmap.c +8 −9 Original line number Original line Diff line number Diff line Loading @@ -1891,13 +1891,10 @@ EXPORT_SYMBOL_GPL(regmap_async_complete); int regmap_register_patch(struct regmap *map, const struct reg_default *regs, int regmap_register_patch(struct regmap *map, const struct reg_default *regs, int num_regs) int num_regs) { { struct reg_default *p; int i, ret; int i, ret; bool bypass; bool bypass; /* If needed the implementation can be extended to support this */ if (map->patch) return -EBUSY; map->lock(map->lock_arg); map->lock(map->lock_arg); bypass = map->cache_bypass; bypass = map->cache_bypass; Loading @@ -1914,11 +1911,13 @@ int regmap_register_patch(struct regmap *map, const struct reg_default *regs, } } } } map->patch = kcalloc(num_regs, sizeof(struct reg_default), GFP_KERNEL); p = krealloc(map->patch, if (map->patch != NULL) { sizeof(struct reg_default) * (map->patch_regs + num_regs), memcpy(map->patch, regs, GFP_KERNEL); num_regs * sizeof(struct reg_default)); if (p) { map->patch_regs = num_regs; memcpy(p + map->patch_regs, regs, num_regs * sizeof(*regs)); map->patch = p; map->patch_regs += num_regs; } else { } else { ret = -ENOMEM; ret = -ENOMEM; } } Loading