Skip to content

Commit 38e3825

Browse files
jnikuladaeinki
authored andcommitted
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: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
1 parent 1f3512c commit 38e3825

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpu/drm/exynos/exynos_drm_vidi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ static int vidi_get_modes(struct drm_connector *connector)
309309
struct vidi_context *ctx = ctx_from_connector(connector);
310310
struct edid *edid;
311311
int edid_len;
312+
int count;
312313

313314
/*
314315
* 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)
328329

329330
drm_connector_update_edid_property(connector, edid);
330331

331-
return drm_add_edid_modes(connector, edid);
332+
count = drm_add_edid_modes(connector, edid);
333+
334+
kfree(edid);
335+
336+
return count;
332337
}
333338

334339
static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = {

0 commit comments

Comments
 (0)