Skip to contentSkip to conversation

regmap: debugfs: Add back in erroneously removed initialisation of ret

PATCH In review Charles Keepax 3 participants 4 messages Sep 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regmap: debugfs: Add back in erroneously removed initialisation of ret

Fixes 94cc89eb8fa5 ("regmap: debugfs: Fix handling of name string for debugfs init delays")
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +1 -1
index d0f7cc574ff34..b24f14ea96d8a 100644
@@ -706,9 +706,9 @@ struct regmap *__regmap_init(struct device *dev,
 			     const char *lock_name)
 {
 	struct regmap *map;
+	int ret = -EINVAL;
 	enum regmap_endian reg_endian, val_endian;
 	int i, j;
-	int ret;
 
 	if (!config)
 		goto err;
Signature · 1 line
2.11.0
maintainer
#1 lore raw
Quoted 1 line · Charles Keepax

Applied to

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

Thanks!

[1/1] regmap: debugfs: Add back in erroneously removed initialisation of ret

      commit: d36cb0205f034e943aa29e35b59c6a441f0056b5

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

#2 lore raw
In reply to Charles Keepax
Quoted 13 lines · Charles Keepax
Fixes 94cc89eb8fa5 ("regmap: debugfs: Fix handling of name string for debugfs init delays")
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +0 -0
index d0f7cc574ff34..b24f14ea96d8a 100644

drivers/base/regmap/regmap.c struct regmap *__regmap_init(struct device *dev, · line 714

Quoted 10 lines
drivers/base/regmap/regmap.c +1 -1
@@ -706,9 +706,9 @@ struct regmap *__regmap_init(struct device *dev,
 			     const char *lock_name)
 {
 	struct regmap *map;
+	int ret = -EINVAL;
 	enum regmap_endian reg_endian, val_endian;
 	int i, j;
-	int ret;
 
 	if (!config)
 		goto err;

Hi Charles, this isn't enough. There are several goto err_map; paths were "ret" is zero. That will result in an Oops in the caller. It has to be an error code.

regards,
dan carpenter

#3 lore raw
Quoted 22 lines · Dan Carpenter
Quoted 21 lines · Charles Keepax
Fixes 94cc89eb8fa5 ("regmap: debugfs: Fix handling of name string for debugfs init delays")
---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +1 -1
index d0f7cc574ff34..b24f14ea96d8a 100644
@@ -706,9 +706,9 @@ struct regmap *__regmap_init(struct device *dev,
 			     const char *lock_name)
 {
 	struct regmap *map;
+	int ret = -EINVAL;
 	enum regmap_endian reg_endian, val_endian;
 	int i, j;
-	int ret;
 
Quoted 7 lines

drivers/base/regmap/regmap.c struct regmap *__regmap_init(struct device *dev, · line 714

Quoted 2 lines
drivers/base/regmap/regmap.c +0 -0
 	if (!config)
 		goto err;

Hi Charles, this isn't enough. There are several goto err_map; paths were "ret" is zero. That will result in an Oops in the caller. It has to be an error code.

Aye, sorry thought it was just cause I removed the initialisation but yeah there is more fall out. Apologies for mucking this up, third time lucky hopefully.

Thanks,
Charles