Skip to contentSkip to conversation

drm/msm/dsi: Move PHY operations out of host

bug report Dan Carpenter 2 participants 2 messages Feb 11, 2017 – Feb 13, 2017

lore
Share & tools
lore
#0 lore raw

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.

   175			ret = enable_phy(msm_dsi, src_pll_id, &shared_timings[id]);
   176			if (ret)

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 34 lines · Dan Carpenter

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);
                                               ^^^^^^^^^^
Quoted 1 line

Unchecked dereference.

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

Thanks,
Archit

Quoted 11 lines
   175			ret = enable_phy(msm_dsi, src_pll_id, &shared_timings[id]);
   176			if (ret)

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel