Skip to content

Commit afc8e3e

Browse files
BuiDucPhucbroonie
authored andcommitted
regcache: Validate cache_only state in regcache_sync_region()
Add a WARN_ON() check to ensure regcache_sync_region() is not called while cache_only is enabled. Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20260720033238.52479-2-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 86fc348 commit afc8e3e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/base/regmap/regcache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,10 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
516516

517517
map->lock(map->lock_arg);
518518

519+
if (WARN_ON(map->cache_only)) {
520+
map->unlock(map->lock_arg);
521+
return -EINVAL;
522+
}
519523
/* Remember the initial bypass state */
520524
bypass = map->cache_bypass;
521525

0 commit comments

Comments
 (0)