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

Commit 3b526cbe authored by David Collins's avatar David Collins Committed by Gerrit - the friendly Code Review server
Browse files

regulator: cpr3-regulator: fix potential aging uninitialized variable usage



If cpr3_ctrl_clear_cpr4_config() returns an error at the
beginning of the cpr3_regulator_measure_aging() function, then
goto cleanup is called.  After that, the *_restore values are
written back into hardware registers.  Unfortunately, these
*_restore variables are uninitialized in this code path.
Correct this issue.

Change-Id: I906613a00137925c9903ac6c01771c459594864f
CRs-Fixed: 1066407
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 351c0011
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -3341,7 +3341,8 @@ static int cpr3_regulator_measure_aging(struct cpr3_controller *ctrl,
		if (rc) {
		if (rc) {
			cpr3_err(ctrl, "failed to clear CPR4 configuration,rc=%d\n",
			cpr3_err(ctrl, "failed to clear CPR4 configuration,rc=%d\n",
				rc);
				rc);
			goto cleanup;
			kfree(quot_delta_results);
			return rc;
		}
		}
	}
	}