regmap: maple: Clear async flag when doing a maple tree cache sync
Subsystems (2)
PATCH 1/1 regmap: maple: Clear async flag when doing a maple tree cache sync
The normal regcache_sync function sets the async flag on the register map. The maple tree sync code uses a temporary buffer, which is freed after the register is written, however, as the async flag is set the buffer might not be used until after it is freed. Fix this by clearing the async flag in the maple tree sync function.
--- drivers/base/regmap/regcache-maple.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/base/regmap/regcache-maple.c +2 -0
@@ -248,6 +248,8 @@ static int regcache_maple_sync(struct regmap *map, unsigned int min,bool sync_needed = false; map->cache_bypass = true; +/* Maple tree sync uses a temporary buffer, so clear async */ + map->async = false;rcu_read_lock ();
Signature · 1 line
2.30.2
Mark Brown
maintainerQuoted 5 lines · Charles Keepax
The normal
regcache_syncfunction sets the async flag on the register map. The maple tree sync code uses a temporary buffer, which is freed after the register is written, however, as the async flag is set the buffer might not be used until after it is freed. Fix this by clearing the async flag in the maple tree sync function.
It would be better to push this down into the rbtree code which is what really wants this.