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

Shankar, Uma uma.shankar at intel.com
Fri Aug 14 13:39:12 UTC 2020



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Nischal
> Varide
> Sent: Friday, August 14, 2020 8:20 AM
> To: intel-gfx at lists.freedesktop.org
> Cc: Varide, Nischal <nischal.varide at intel.com>
> Subject: [Intel-gfx] [PATCH 1/8] Critical KlockWork Error - Fixes - intel_cdclk.c -
> Possible NullPointerDereference1

Add some commit description explaining the clockwork warning.

Also append all display patches (in display folder) with "drm/i915/display :"
in the commit headers. For generic path have "drm/i915:" as prefix.
Please check the format used in patches already merged to tree.

> ---
>  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);

Is this typecast really needed ?

> 
>  	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);

Same here.

> +
> +
> 
>  	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
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list