Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcda4321 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: Fix the error handling if create_regulator fails



In the case of create_regulator() fails, goto the error path immediately.
It does not make sense to update rdev->open_count if create_regulator fails.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a398eaa2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1282,6 +1282,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
	if (regulator == NULL) {
		regulator = ERR_PTR(-ENOMEM);
		module_put(rdev->owner);
		goto out;
	}

	rdev->open_count++;