Commit e62fb64e authored by Chris Wilson's avatar Chris Wilson Committed by Dave Airlie

drm: Check for a NULL encoder when reverting on error path

We need to skip the connectors with a NULL encoder to match the success
path and avoid an OOPS.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 85a7bb98
...@@ -775,8 +775,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) ...@@ -775,8 +775,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fail_set_mode: fail_set_mode:
set->crtc->enabled = save_enabled; set->crtc->enabled = save_enabled;
count = 0; 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++]; connector->encoder->crtc = save_crtcs[count++];
}
fail_no_encoder: fail_no_encoder:
kfree(save_crtcs); kfree(save_crtcs);
count = 0; count = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment