diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2020-09-18 18:22:12 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-09-22 02:11:45 +0300 |
commit | 1d512ee861b80da63cbc501b973c53131aa22f29 (patch) | |
tree | 3f3cb1bcf3f1db404643548b51a4793098bce376 /drivers/base/regmap/regmap.c | |
parent | 0c2191c3da345e0fe73118445ddb1f0df114aadf (diff) | |
download | linux-1d512ee861b80da63cbc501b973c53131aa22f29.tar.xz |
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/regmap.c')
-rw-r--r-- | drivers/base/regmap/regmap.c | 2 |
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; |