Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jani Nikula and committed by
Inki Dae
38e38256 1f3512cd

+6 -1
+6 -1
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 309 309 struct vidi_context *ctx = ctx_from_connector(connector); 310 310 struct edid *edid; 311 311 int edid_len; 312 + int count; 312 313 313 314 /* 314 315 * the edid data comes from user side and it would be set ··· 329 328 330 329 drm_connector_update_edid_property(connector, edid); 331 330 332 - return drm_add_edid_modes(connector, edid); 331 + count = drm_add_edid_modes(connector, edid); 332 + 333 + kfree(edid); 334 + 335 + return count; 333 336 } 334 337 335 338 static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = {