Skip to content

Commit

Permalink
regmap: cache: bail in regmap_async_complete() for bus-less maps
Browse files Browse the repository at this point in the history
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 <zonque@gmail.com>
Cc: stable@vger.kernel.org [v3.10 only]
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Daniel Mack authored and Mark Brown committed Jul 4, 2013
1 parent 8bb495e commit f2e055e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ int regmap_async_complete(struct regmap *map)
int ret;

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

trace_regmap_async_complete_start(map->dev);
Expand Down

0 comments on commit f2e055e

Please sign in to comment.