mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
drm/exynos/vidi: fix memory leak in .get_modes()
commit 38e3825631
upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
22f742b8f7
commit
cb3ac23343
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||||
|
|
||||||
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 = {
|
||||||
|
|
Loading…
Reference in a new issue