[PATCH 1/4] drm/exynos/vidi: fix memory leak in .get_modes()

Inki Dae daeinki at gmail.com
Mon Jun 10 06:32:45 UTC 2024


Hi Jani Nikula,

The patch(1/4) has been applied to the -fixes branch, and the other
three patches(2/4 ~ 4/4) have been applied to the -next branch.

Thanks,
Inki Dae

2024년 5월 30일 (목) 오후 7:02, Jani Nikula <jani.nikula at intel.com>님이 작성:
>
> The duplicated EDID is never freed. Fix it.
>
> Cc: stable at vger.kernel.org
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index fab135308b70..11a720fef32b 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -309,6 +309,7 @@ static int vidi_get_modes(struct drm_connector *connector)
>         struct vidi_context *ctx = ctx_from_connector(connector);
>         struct edid *edid;
>         int edid_len;
> +       int count;
>
>         /*
>          * 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);
>
> -       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 = {
> --
> 2.39.2
>
>


More information about the dri-devel mailing list