Commit 38e38256 authored by Jani Nikula's avatar Jani Nikula Committed by Inki Dae

drm/exynos/vidi: fix memory leak in .get_modes()

The duplicated EDID is never freed. Fix it.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 1f3512cd
...@@ -309,6 +309,7 @@ static int vidi_get_modes(struct drm_connector *connector) ...@@ -309,6 +309,7 @@ static int vidi_get_modes(struct drm_connector *connector)
struct vidi_context *ctx = ctx_from_connector(connector); struct vidi_context *ctx = ctx_from_connector(connector);
struct edid *edid; struct edid *edid;
int edid_len; int edid_len;
int count;
/* /*
* the edid data comes from user side and it would be set * the edid data comes from user side and it would be set
...@@ -328,7 +329,11 @@ static int vidi_get_modes(struct drm_connector *connector) ...@@ -328,7 +329,11 @@ static int vidi_get_modes(struct drm_connector *connector)
drm_connector_update_edid_property(connector, edid); drm_connector_update_edid_property(connector, edid);
return drm_add_edid_modes(connector, edid); count = drm_add_edid_modes(connector, edid);
kfree(edid);
return count;
} }
static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = { static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = {
......
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