diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 8fe6e08fa41ee426c5317727784a21450e1e6d12..707b0450ad720d914d8f6617db1f94602f7db4c1 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -2050,10 +2050,9 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val, return -EINVAL; wval = kmemdup(val, val_count * val_bytes, map->alloc_flags); - if (!wval) { - dev_err(map->dev, "Error in memory allocation\n"); + if (!wval) return -ENOMEM; - } + for (i = 0; i < val_count * val_bytes; i += val_bytes) map->format.parse_inplace(wval + i);