Skip to content

Commit

Permalink
drm: Check for a NULL encoder when reverting on error path
Browse files Browse the repository at this point in the history
We need to skip the connectors with a NULL encoder to match the success
path and avoid an OOPS.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Chris Wilson authored and Dave Airlie committed Feb 20, 2009
1 parent 85a7bb9 commit e62fb64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fail_set_mode:
set->crtc->enabled = save_enabled;
count = 0;
list_for_each_entry(connector, &dev->mode_config.connector_list, head)
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (!connector->encoder)
continue;

connector->encoder->crtc = save_crtcs[count++];
}
fail_no_encoder:
kfree(save_crtcs);
count = 0;
Expand Down

0 comments on commit e62fb64

Please sign in to comment.