Check if regs are readable. Signed-off-by: Michal Simek <[email protected]> ---
drivers/base/regmap/regmap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6a19515..7569dfc 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1725,6 +1725,9 @@ static int _regmap_read(struct regmap *map, unsigned int
reg,
int ret;
void *context = _regmap_map_get_context(map);
+ if (!regmap_readable(map, reg))
+ return -EIO;
+
WARN_ON(!map->reg_read);
if (!map->cache_bypass) {
--
1.8.2.3
pgpU1xFyyx7xi.pgp
Description: PGP signature

