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

Commit 4a0acb16 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mhl: sii8334: Fix null pointer dereference at power off"

parents 1c0e9ecc 08fae6be
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ static int mhl_sii_config(struct mhl_tx_ctrl *mhl_ctrl, bool on)

	client = mhl_ctrl->i2c_handle;

	if (on) {
	if (on && !mhl_ctrl->irq_req_done) {
		rc = mhl_vreg_config(mhl_ctrl, 1);
		if (rc) {
			pr_err("%s: vreg init failed [%d]\n",
@@ -424,7 +424,7 @@ static int mhl_sii_config(struct mhl_tx_ctrl *mhl_ctrl, bool on)
		} else {
			mhl_ctrl->irq_req_done = true;
		}
	} else {
	} else if (!on && mhl_ctrl->irq_req_done) {
		free_irq(mhl_ctrl->i2c_handle->irq, mhl_ctrl);
		mhl_gpio_config(mhl_ctrl, 0);
		mhl_vreg_config(mhl_ctrl, 0);
@@ -1533,22 +1533,29 @@ static int mhl_sii_reg_config(struct i2c_client *client, bool enable)
	pr_debug("%s\n", __func__);

	if (!enable) {
		if (reg_8941_vdda) {
			regulator_disable(reg_8941_vdda);
			regulator_put(reg_8941_vdda);
			reg_8941_vdda = NULL;
		}

		if (reg_8941_smps3a) {
			regulator_disable(reg_8941_smps3a);
			regulator_put(reg_8941_smps3a);
			reg_8941_smps3a = NULL;
		}

		if (reg_8941_l02) {
			regulator_disable(reg_8941_l02);
			regulator_put(reg_8941_l02);
			reg_8941_l02 = NULL;
		}

		if (reg_8941_l24) {
			regulator_disable(reg_8941_l24);
			regulator_put(reg_8941_l24);
			reg_8941_l24 = NULL;

		}
		return 0;
	}