mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-12-04 21:40:56 -06:00
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>
This commit is contained in:
@@ -516,6 +516,10 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
|
||||
|
||||
map->lock(map->lock_arg);
|
||||
|
||||
if (WARN_ON(map->cache_only)) {
|
||||
map->unlock(map->lock_arg);
|
||||
return -EINVAL;
|
||||
}
|
||||
/* Remember the initial bypass state */
|
||||
bypass = map->cache_bypass;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user