瀏覽代碼

disp: msm: sde: Fix null dereference errors

Add changes to avoid NULL dereference access and
uninitalized access in sde driver.

Change-Id: Ic9c06f54d1ccd820973fc0ba4aa75d2848f2ce03
Signed-off-by: Jayaprakash <[email protected]>
Jayaprakash 5 年之前
父節點
當前提交
11aab5f9c3
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 3 0
      msm/sde/sde_core_perf.c
  2. 1 1
      msm/sde/sde_rm.c

+ 3 - 0
msm/sde/sde_core_perf.c

@@ -818,6 +818,9 @@ static void _sde_core_perf_crtc_update_check(struct drm_crtc *crtc,
 	struct sde_core_perf_params *new = &sde_crtc->new_perf;
 	int i;
 
+	if (!kms)
+		return;
+
 	for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX; i++) {
 		/*
 		 * cases for bus bandwidth update.

+ 1 - 1
msm/sde/sde_rm.c

@@ -2346,7 +2346,7 @@ int sde_rm_reserve(
 	 * comes again after earlier commit gets processed.
 	 */
 
-	if (test_only && rsvp_nxt) {
+	if (test_only && rsvp_cur && rsvp_nxt) {
 		SDE_ERROR("cur %d nxt %d enc %d conn %d\n", rsvp_cur->seq,
 			 rsvp_nxt->seq, enc->base.id,
 			 conn_state->connector->base.id);