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

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

regulator: Fix checking return value of create_regulator



create_regulator() returns NULL on fail.

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent bcda4321
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -985,9 +985,8 @@ static int set_supply(struct regulator_dev *rdev,
	rdev_info(rdev, "supplied by %s\n", rdev_get_name(supply_rdev));

	rdev->supply = create_regulator(supply_rdev, &rdev->dev, "SUPPLY");
	if (IS_ERR(rdev->supply)) {
		err = PTR_ERR(rdev->supply);
		rdev->supply = NULL;
	if (rdev->supply == NULL) {
		err = -ENOMEM;
		return err;
	}