Skip to content

Commit

Permalink
drm/i915: Don't deref NULL crtc in intel_get_pipe_from_connector()
Browse files Browse the repository at this point in the history
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@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Ville Syrjälä authored and Daniel Vetter committed Nov 14, 2014
1 parent 2d72f6c commit d3babd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -11999,7 +11999,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;
Expand Down

0 comments on commit d3babd3

Please sign in to comment.