2020-09-18 15:35:56

by Charles Keepax

[permalink] [raw]
Subject: [PATCH] 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]>
---
drivers/base/regmap/regmap.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index b24f14ea96d8a..4c2a114584236 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -723,6 +723,8 @@ struct regmap *__regmap_init(struct device *dev,
if (ret)
goto err_map;

+ 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;
--
2.11.0


2020-09-22 01:00:41

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regmap: debugfs: Fix more error path regressions

On Fri, 18 Sep 2020 16:22:12 +0100, Charles Keepax wrote:
> 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.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next

Thanks!

[1/1] regmap: debugfs: Fix more error path regressions
commit: 1d512ee861b80da63cbc501b973c53131aa22f29

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark