Due to asynchronous driver probing there is a chance that the dummy regulator hasn't already been probed when first accessing it.
Cc: stable@vger.kernel.org Signed-off-by: Christian Eggers ceggers@arri.de --- drivers/regulator/core.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4ddf0efead68..bb9fe44aea11 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2069,6 +2069,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (have_full_constraints()) { r = dummy_regulator_rdev; + BUG_ON(!r); get_device(&r->dev); } else { dev_err(dev, "Failed to resolve %s-supply for %s\n", @@ -2086,6 +2087,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) goto out; } r = dummy_regulator_rdev; + BUG_ON(!r); get_device(&r->dev); }
@@ -2213,6 +2215,7 @@ struct regulator *_regulator_get_common(struct regulator_dev *rdev, struct devic */ dev_warn(dev, "supply %s not found, using dummy regulator\n", id); rdev = dummy_regulator_rdev; + BUG_ON(!rdev); get_device(&rdev->dev); break;