Procházet zdrojové kódy

disp: msm: sde: add null pointer check for encoder current master

During virt enable call, sde_enc master will be removed and
re-assigned. If an underrun is observed during this
scenario, it results in crash due to uninitialized access.
This change handles the above scenario.

Change-Id: Iec9e4a0bc4b763e44933334dacf82f1439eacc17
Signed-off-by: Yashwanth <[email protected]>
Yashwanth před 4 roky
rodič
revize
35b948550d
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      msm/sde/sde_encoder.c

+ 2 - 1
msm/sde/sde_encoder.c

@@ -3021,7 +3021,8 @@ static void sde_encoder_underrun_callback(struct drm_encoder *drm_enc,
 	SDE_ATRACE_BEGIN("encoder_underrun_callback");
 	atomic_inc(&phy_enc->underrun_cnt);
 	SDE_EVT32(DRMID(drm_enc), atomic_read(&phy_enc->underrun_cnt));
-	if (sde_enc->cur_master->ops.get_underrun_line_count)
+	if (sde_enc->cur_master &&
+			sde_enc->cur_master->ops.get_underrun_line_count)
 		sde_enc->cur_master->ops.get_underrun_line_count(
 				sde_enc->cur_master);