summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2020-09-18 16:22:12 +0100
committerMark Brown <broonie@kernel.org>2020-09-22 00:11:45 +0100
commit1d512ee861b80da63cbc501b973c53131aa22f29 (patch)
tree3f3cb1bcf3f1db404643548b51a4793098bce376 /drivers/base/regmap
parent0c2191c3da345e0fe73118445ddb1f0df114aadf (diff)
downloadlinux-1d512ee861b80da63cbc501b973c53131aa22f29.tar.bz2
regmap: debugfs: Fix more error path regressions
Many error paths in __regmap_init rely on ret being pre-initialised to -EINVAL, add an extra initialisation in after the new call to regmap_set_name. Fixes: 94cc89eb8fa5 ("regmap: debugfs: Fix handling of name string for debugfs init delays") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20200918152212.22200-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r--drivers/base/regmap/regmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 51db0f88f164..a4d3d41f5221 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -707,6 +707,8 @@ struct regmap *__regmap_init(struct device *dev,
}
}
+ ret = -EINVAL; /* Later error paths rely on this */
+
if (config->disable_locking) {
map->lock = map->unlock = regmap_lock_unlock_none;
map->can_sleep = config->can_sleep;