Skip to content

Commit f2e055e

Browse files
zonquebroonie
authored andcommitted
regmap: cache: bail in regmap_async_complete() for bus-less maps
Commit f8bd822 ("regmap: cache: Factor out block sync") made regcache_rbtree_sync() call regmap_async_complete(), which in turn does not check for map->bus before dereferencing it. This causes a NULL pointer dereference on bus-less maps. Signed-off-by: Daniel Mack <[email protected]> Cc: [email protected] [v3.10 only] Signed-off-by: Mark Brown <[email protected]>
1 parent 8bb495e commit f2e055e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/regmap/regmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ int regmap_async_complete(struct regmap *map)
17171717
int ret;
17181718

17191719
/* Nothing to do with no async support */
1720-
if (!map->bus->async_write)
1720+
if (!map->bus || !map->bus->async_write)
17211721
return 0;
17221722

17231723
trace_regmap_async_complete_start(map->dev);

0 commit comments

Comments
 (0)