diff options
author | Charles Keepax <[email protected]> | 2020-09-18 16:22:12 +0100 |
---|---|---|
committer | Mark Brown <[email protected]> | 2020-09-22 00:11:45 +0100 |
commit | 1d512ee861b80da63cbc501b973c53131aa22f29 (patch) | |
tree | 3f3cb1bcf3f1db404643548b51a4793098bce376 | |
parent | 0c2191c3da345e0fe73118445ddb1f0df114aadf (diff) |
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 <[email protected]>
Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
-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; |