Skip to contentSkip to conversation

iregulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()

PATCH In review Peng Wu 2 participants 2 messages Nov 22, 2022 Voltage and current regulator framework

lore
Share & tools
lore

Peng Wu

author
#0 lore raw

PATCH 1/1 iregulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()

The regulator_get() function never returns NULL. It returns error pointers.

Fixes 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all")
---
 drivers/regulator/of_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/of_regulator.c +1 -1
index 584c92f1a317..f7529f1bf8b2 100644
@@ -767,7 +767,7 @@ int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
 			memcpy(name, prop->name, i);
 			name[i] = '\0';
 			tmp = regulator_get(dev, name);
-			if (!tmp) {
+			if (IS_ERR(tmp)) {
 				ret = -EINVAL;
 				goto error;
 			}
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 3 lines · Peng Wu

The regulator_get() function never returns NULL. It returns error pointers.

Applied to

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

Thanks!

[1/1] iregulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()

      commit: c957387c402a1a213102e38f92b800d7909a728d

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