提交 acd8db10 编写于 作者: P Paulo Zanoni 提交者: Daniel Vetter

drm/i915: don't check encoder at DP connector destroy()

By the time we call intel_dp_destroy (which destroys the connector)
the encoder may have been destroyed already, so if we use it we may be
reading some free memory. That happens in drm_mode_config_cleanup()
and also inside intel_dp_init_connector() when we detect a ghost eDP.

I also hope this may solve some random memory bugs.

Reported by kmemcheck.
Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: NZoltan Nyul <zoltan.nyul@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 d482e5fa
...@@ -2683,13 +2683,14 @@ intel_dp_set_property(struct drm_connector *connector, ...@@ -2683,13 +2683,14 @@ intel_dp_set_property(struct drm_connector *connector,
static void static void
intel_dp_destroy(struct drm_connector *connector) intel_dp_destroy(struct drm_connector *connector)
{ {
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct intel_connector *intel_connector = to_intel_connector(connector); struct intel_connector *intel_connector = to_intel_connector(connector);
if (!IS_ERR_OR_NULL(intel_connector->edid)) if (!IS_ERR_OR_NULL(intel_connector->edid))
kfree(intel_connector->edid); kfree(intel_connector->edid);
if (is_edp(intel_dp)) /* Can't call is_edp() since the encoder may have been destroyed
* already. */
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP)
intel_panel_fini(&intel_connector->panel); intel_panel_fini(&intel_connector->panel);
drm_sysfs_connector_remove(connector); drm_sysfs_connector_remove(connector);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册