[Intel-gfx] [PATCH 1/8] Critical KlockWork Error - Fixes - intel_cdclk.c - Possible NullPointerDereference1

Nischal Varide nischal.varide at intel.com
Fri Aug 14 02:49:43 UTC 2020


---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 9d6cacbdb691..1cd0ab5b36d2 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -1926,7 +1926,11 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state)
 		intel_atomic_get_old_cdclk_state(state);
 	const struct intel_cdclk_state *new_cdclk_state =
 		intel_atomic_get_new_cdclk_state(state);
-	enum pipe pipe = new_cdclk_state->pipe;
+	enum pipe pipe;
+
+	if (!(old_cdclk_state && new_cdclk_state))
+		return
+	(void)(pipe = new_cdclk_state->pipe);
 
 	if (!intel_cdclk_changed(&old_cdclk_state->actual,
 				 &new_cdclk_state->actual))
@@ -1955,7 +1959,13 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state)
 		intel_atomic_get_old_cdclk_state(state);
 	const struct intel_cdclk_state *new_cdclk_state =
 		intel_atomic_get_new_cdclk_state(state);
-	enum pipe pipe = new_cdclk_state->pipe;
+	enum pipe pipe;
+
+	if (!(old_cdclk_state && new_cdclk_state))
+		return
+	(void)(pipe = new_cdclk_state->pipe);
+
+
 
 	if (!intel_cdclk_changed(&old_cdclk_state->actual,
 				 &new_cdclk_state->actual))
@@ -2484,6 +2494,9 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
 
 	old_cdclk_state = intel_atomic_get_old_cdclk_state(state);
 
+	if (!(old_cdclk_state && new_cdclk_state))
+		return
+
 	new_cdclk_state->active_pipes =
 		intel_calc_active_pipes(state, old_cdclk_state->active_pipes);
 
-- 
2.26.0



More information about the Intel-gfx mailing list