[bug report] drm/msm/dsi: Move PHY operations out of host

Archit Taneja architt at codeaurora.org
Mon Feb 13 05:29:31 UTC 2017



On 02/11/2017 10:47 AM, Dan Carpenter wrote:
> Hello Hai Li,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch b62aa70a98c5: "drm/msm/dsi: Move PHY operations out of
> host" from Jan 7, 2017, leads to the following Smatch complaint:
>
> ./drivers/gpu/drm/msm/dsi/dsi_manager.c:174 dsi_mgr_phy_enable()
> 	 error: we previously assumed 'mdsi' could be null (see line 157)
>
> ./drivers/gpu/drm/msm/dsi/dsi_manager.c
>    156		 */
>    157		if (IS_DUAL_DSI() && mdsi && sdsi) {
>                                      ^^^^
> Check for NULL.
>
>    158			if (!mdsi->phy_enabled && !sdsi->phy_enabled) {
>    159				msm_dsi_host_reset_phy(mdsi->host);
>    160				msm_dsi_host_reset_phy(sdsi->host);
>    161	
>    162				ret = enable_phy(mdsi, src_pll_id,
>    163						 &shared_timings[DSI_CLOCK_MASTER]);
>    164				if (ret)
>    165					return ret;
>    166				ret = enable_phy(sdsi, src_pll_id,
>    167						 &shared_timings[DSI_CLOCK_SLAVE]);
>    168				if (ret) {
>    169					msm_dsi_phy_disable(mdsi->phy);
>    170					return ret;
>    171				}
>    172			}
>    173		} else {
>    174			msm_dsi_host_reset_phy(mdsi->host);
>                                                ^^^^^^^^^^
> Unchecked dereference.

This looks like a typo, it should have been msm_dsi->host. Will post a patch
to fix this.

Thanks,
Archit

>
>    175			ret = enable_phy(msm_dsi, src_pll_id, &shared_timings[id]);
>    176			if (ret)
>
> regards,
> dan carpenter
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


More information about the dri-devel mailing list