val_len should be a multiple of val_bytes. If it's not, error out early.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
{
int ret;
+ if (val_len % map->format.val_bytes)
+ return -EINVAL;
+
map->lock(map);
ret = _regmap_raw_write(map, reg, val, val_len);
unsigned int v;
int ret, i;
+ if (val_len % map->format.val_bytes)
+ return -EINVAL;
+
map->lock(map);
if (regmap_volatile_range(map, reg, val_count) || map->cache_bypass ||