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

Commit 752ecc17 authored by Harry Yang's avatar Harry Yang
Browse files

qcom-charger: Fix crash due to null ptr access of pl psy



pl psy access is guarded by pl_disable_votable, disabled in PMI
probe. Accessing parallel psy before it is available will cause
crash.

Fix this by allowing access to parallel psy only after all the
initial votes have been cast on pl_disable_votable in probe.

CRs-Fixed: 1101600
Change-Id: Idd289229f45c31cf8fd234339b6738bd241283bd
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 3b113a5b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1884,6 +1884,12 @@ static int smb2_probe(struct platform_device *pdev)
		goto cleanup;
	}

	rc = smb2_init_hw(chip);
	if (rc < 0) {
		pr_err("Couldn't initialize hardware rc=%d\n", rc);
		goto cleanup;
	}

	rc = smb2_init_dc_psy(chip);
	if (rc < 0) {
		pr_err("Couldn't initialize dc psy rc=%d\n", rc);
@@ -1916,12 +1922,6 @@ static int smb2_probe(struct platform_device *pdev)
		goto cleanup;
	}

	rc = smb2_init_hw(chip);
	if (rc < 0) {
		pr_err("Couldn't initialize hardware rc=%d\n", rc);
		goto cleanup;
	}

	rc = smb2_determine_initial_status(chip);
	if (rc < 0) {
		pr_err("Couldn't determine initial status rc=%d\n",