Skip to content

Commit ef60abb

Browse files
committed
regulator: core: Always use return value when regulator_dev_lookup() fails
Ensure that the return value is always set when we return now that the logic has changed for regulator_get_optional() so we don't get missing codes leaking out. Reported-by: Thierry Reding <treding@nvidia.com> Tested-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent 9b92da1 commit ef60abb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/regulator/core.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,12 +1263,13 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
12631263
if (rdev)
12641264
goto found;
12651265

1266+
regulator = ERR_PTR(ret);
1267+
12661268
/*
12671269
* If we have return value from dev_lookup fail, we do not expect to
12681270
* succeed, so, quit with appropriate error value
12691271
*/
12701272
if (ret && ret != -ENODEV) {
1271-
regulator = ERR_PTR(ret);
12721273
goto out;
12731274
}
12741275

0 commit comments

Comments
 (0)