diff options
author | Daniel Mack <zonque@gmail.com> | 2013-07-04 07:11:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-04 04:50:58 -0400 |
commit | 8acd5b1eaaf5b06ca149e697ed2a017a748bcd57 (patch) | |
tree | e2549e6b5fde9e9909c71561a08eab5cb41c3b2b /drivers/base | |
parent | e39992ecaa7230126f96285a19493a9883294fdf (diff) |
regmap: cache: bail in regmap_async_complete() for bus-less maps
commit f2e055e7c9c6084bfbaa68701e52562acf96419e upstream.
Commit f8bd822cb ("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>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index a941dcfe7590..d0c81d1f409c 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -1717,7 +1717,7 @@ int regmap_async_complete(struct regmap *map) | |||
1717 | int ret; | 1717 | int ret; |
1718 | 1718 | ||
1719 | /* Nothing to do with no async support */ | 1719 | /* Nothing to do with no async support */ |
1720 | if (!map->bus->async_write) | 1720 | if (!map->bus || !map->bus->async_write) |
1721 | return 0; | 1721 | return 0; |
1722 | 1722 | ||
1723 | trace_regmap_async_complete_start(map->dev); | 1723 | trace_regmap_async_complete_start(map->dev); |