Browse Source

disp: msm: sde: add proper null checks before hw_intf access

This change adds proper null checking before trying to access
hw_intf pointer.

Change-Id: Id1817dca24c176c0c97bf7d637ca08da31693c37
Signed-off-by: Samantha Tran <[email protected]>
Samantha Tran 4 years ago
parent
commit
dc162469ab
2 changed files with 2 additions and 2 deletions
  1. 1 1
      msm/sde/sde_encoder_dce.c
  2. 1 1
      msm/sde/sde_encoder_phys.h

+ 1 - 1
msm/sde/sde_encoder_dce.c

@@ -52,7 +52,7 @@ bool sde_encoder_is_dsc_merge(struct drm_encoder *drm_enc)
 		return false;
 
 	phys_enc = sde_enc->phys_encs[0];
-	if (phys_enc->hw_intf->cfg.split_link_en)
+	if (phys_enc && phys_enc->hw_intf && phys_enc->hw_intf->cfg.split_link_en)
 		return false;
 
 	topology = sde_connector_get_topology_name(drm_conn);

+ 1 - 1
msm/sde/sde_encoder_phys.h

@@ -620,7 +620,7 @@ static inline enum sde_3d_blend_mode sde_encoder_helper_get_3d_blend_mode(
 	if (ret)
 		return BLEND_3D_NONE;
 
-	if (phys_enc->hw_intf->cfg.split_link_en)
+	if (phys_enc->hw_intf && phys_enc->hw_intf->cfg.split_link_en)
 		return BLEND_3D_NONE;
 
 	num_lm = def.num_lm;