Commit ebda95a9 authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915: Do not free the passed EDID in intel_connector_update_modes()

The caller, not intel_connector_update_modes(), should free the edid. This
improves the reusability of intel_connector_update_modes().
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent dd06f90e
...@@ -418,12 +418,16 @@ static int intel_crt_ddc_get_modes(struct drm_connector *connector, ...@@ -418,12 +418,16 @@ static int intel_crt_ddc_get_modes(struct drm_connector *connector,
struct i2c_adapter *adapter) struct i2c_adapter *adapter)
{ {
struct edid *edid; struct edid *edid;
int ret;
edid = intel_crt_get_edid(connector, adapter); edid = intel_crt_get_edid(connector, adapter);
if (!edid) if (!edid)
return 0; return 0;
return intel_connector_update_modes(connector, edid); ret = intel_connector_update_modes(connector, edid);
kfree(edid);
return ret;
} }
static bool intel_crt_detect_ddc(struct drm_connector *connector) static bool intel_crt_detect_ddc(struct drm_connector *connector)
......
...@@ -45,7 +45,6 @@ int intel_connector_update_modes(struct drm_connector *connector, ...@@ -45,7 +45,6 @@ int intel_connector_update_modes(struct drm_connector *connector,
drm_mode_connector_update_edid_property(connector, edid); drm_mode_connector_update_edid_property(connector, edid);
ret = drm_add_edid_modes(connector, edid); ret = drm_add_edid_modes(connector, edid);
drm_edid_to_eld(connector, edid); drm_edid_to_eld(connector, edid);
kfree(edid);
return ret; return ret;
} }
...@@ -61,12 +60,16 @@ int intel_ddc_get_modes(struct drm_connector *connector, ...@@ -61,12 +60,16 @@ int intel_ddc_get_modes(struct drm_connector *connector,
struct i2c_adapter *adapter) struct i2c_adapter *adapter)
{ {
struct edid *edid; struct edid *edid;
int ret;
edid = drm_get_edid(connector, adapter); edid = drm_get_edid(connector, adapter);
if (!edid) if (!edid)
return 0; return 0;
return intel_connector_update_modes(connector, edid); ret = intel_connector_update_modes(connector, edid);
kfree(edid);
return ret;
} }
static const struct drm_prop_enum_list force_audio_names[] = { static const struct drm_prop_enum_list force_audio_names[] = {
......
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