Skip to content

Commit

Permalink
drm/crtc_helper: avoid NULL-pointer dereference when encoder is NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Maarten Maathuis authored and Dave Airlie committed Sep 2, 2009
1 parent 9c552dd commit ff6fdbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
/* If the encoder is reused for another connector, then
* the appropriate crtc will be set later.
*/
connector->encoder->crtc = NULL;
if (connector->encoder)
connector->encoder->crtc = NULL;
connector->encoder = new_encoder;
}
}
Expand Down

0 comments on commit ff6fdbe

Please sign in to comment.