[Intel-gfx] [PATCH 3/6] drm/i915: Don't deref NULL crtc in intel_get_pipe_from_connector()

Jani Nikula jani.nikula at linux.intel.com
Fri Nov 7 12:32:58 CET 2014


On Fri, 07 Nov 2014, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> If the connector would have an encoder but the encoder didn't have a
> crtc we might dereference a NULL crtc here. I suppose that should never
> happen due to intel_sanitize_encoder(), but let's be a bit paranoid
> print a warning if we ever hit this and return INVALID_PIPE to the
> caller.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9ec1ab7..b9529d0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12074,7 +12074,7 @@ enum pipe intel_get_pipe_from_connector(struct intel_connector *connector)
>  
>  	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
>  
> -	if (!encoder)
> +	if (!encoder || WARN_ON(!encoder->crtc))
>  		return INVALID_PIPE;
>  
>  	return to_intel_crtc(encoder->crtc)->pipe;
> -- 
> 2.0.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center



More information about the Intel-gfx mailing list