浏览代码

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: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Chris Wilson 16 年之前
父节点
当前提交
e62fb64e61
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      drivers/gpu/drm/drm_crtc_helper.c

+ 5 - 1
drivers/gpu/drm/drm_crtc_helper.c

@@ -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;