From: Daniel Mack Date: Thu, 4 Jul 2013 11:11:03 +0000 (+0200) Subject: regmap: cache: bail in regmap_async_complete() for bus-less maps X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8acd5b1eaaf5b06ca149e697ed2a017a748bcd57;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index a941dcfe759..d0c81d1f409 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -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);