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

Commit dc0cf5c9 authored by Charles Bin's avatar Charles Bin
Browse files

mdss: hdmi: Fix null dereferences



Fix potential null dereferences in driver.

Change-Id: I47791e09094ef2b6e64660ef62328e5c1f03bd3e
Signed-off-by: default avatarCharles Bin <cbin@codeaurora.org>
parent f9e5104e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ static int hdmi_hdcp_authentication_part1(struct hdmi_hdcp_ctrl *hdcp_ctrl)
error:
	if (rc) {
		DEV_ERR("%s: %s: Authentication Part I failed\n", __func__,
			HDCP_STATE_NAME);
			hdcp_ctrl ? HDCP_STATE_NAME : "???");
	} else {
		/* Enable HDCP Encryption */
		DSS_REG_W(io, HDMI_HDCP_CTRL, BIT(0) | BIT(8));
@@ -1041,7 +1041,7 @@ static int hdmi_hdcp_authentication_part2(struct hdmi_hdcp_ctrl *hdcp_ctrl)
error:
	if (rc)
		DEV_ERR("%s: %s: Authentication Part II failed\n", __func__,
			HDCP_STATE_NAME);
			hdcp_ctrl ? HDCP_STATE_NAME : "???");
	else
		DEV_INFO("%s: %s: Authentication Part II successful\n",
			__func__, HDCP_STATE_NAME);
+7 −4
Original line number Diff line number Diff line
@@ -1403,6 +1403,11 @@ static int hdmi_tx_set_video_fmt(struct hdmi_tx_ctrl *hdmi_ctrl,

	timing = hdmi_get_supported_mode(hdmi_ctrl->video_resolution);

	if (!timing) {
		DEV_ERR("%s: invalid input\n", __func__);
		return -EINVAL;
	}

	/* todo: find a better way */
	hdmi_ctrl->pdata.power_data[HDMI_TX_CORE_PM].clk_config[0].rate =
		timing->pixel_freq * 1000;
@@ -3394,8 +3399,7 @@ static int hdmi_tx_get_dt_clk_data(struct device *dev,

	if (!dev || !mp) {
		DEV_ERR("%s: invalid input\n", __func__);
		rc = -EINVAL;
		goto error;
		return -EINVAL;
	}

	DEV_DBG("%s: module: '%s'\n", __func__, hdmi_tx_pm_name(module_type));
@@ -3501,8 +3505,7 @@ static int hdmi_tx_get_dt_vreg_data(struct device *dev,

	if (!dev || !mp) {
		DEV_ERR("%s: invalid input\n", __func__);
		rc = -EINVAL;
		goto error;
		return -EINVAL;
	}

	switch (module_type) {