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

Commit a9cbae28 authored by Chandan Uddaraju's avatar Chandan Uddaraju Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: dsi: fix NULL pointer access while changing resolution



During "adb shell stop/start", CTL structure gets destroyed.
Add check for CTL pointer before trying to change resolution. Remove
additional frame rate and clock rate parsing since it already done
while parsing the timing settings. Initialize timing structure
entries to zero before updating the structure.

CRs-fixed: 873962
Change-Id: Iebb2168eef0e002b98afa46b510b028f8ea183b1
Signed-off-by: default avatarChandan Uddaraju <chandanu@codeaurora.org>
parent cc9da09f
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -2232,6 +2232,7 @@ static int mdss_panel_parse_display_timings(struct device_node *np,
	timings_np = of_get_child_by_name(np, "qcom,mdss-dsi-display-timings");
	if (!timings_np) {
		struct dsi_panel_timing pt;
		memset(&pt, 0, sizeof(struct dsi_panel_timing));

		/*
		 * display timings node is not available, fallback to reading
@@ -2464,13 +2465,6 @@ static int mdss_panel_parse_dt(struct device_node *np,
		pinfo->mode_gpio_state = MODE_GPIO_NOT_VALID;
	}

	rc = of_property_read_u32(np, "qcom,mdss-dsi-panel-framerate", &tmp);
	pinfo->mipi.frame_rate = (!rc ? tmp : 60);

	pinfo->clk_rate = 0;
	of_property_read_u64(np, "qcom,mdss-dsi-panel-clockrate",
		&pinfo->clk_rate);

	rc = of_property_read_u32(np, "qcom,mdss-mdp-transfer-time-us", &tmp);
	pinfo->mdp_transfer_time_us = (!rc ? tmp : DEFAULT_MDP_TRANSFER_TIME);

+5 −0
Original line number Diff line number Diff line
@@ -4818,6 +4818,11 @@ static int mdss_mdp_update_panel_info(struct msm_fb_data_type *mfd,
	struct mdss_panel_data *pdata;
	struct mdss_mdp_ctl *sctl;

	if (ctl == NULL) {
		pr_debug("ctl not initialized\n");
		return 0;
	}

	ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_DSI_UPDATE_PANEL_DATA,
		(void *)(unsigned long)mode, false);
	if (ret)