drm/vc4: Fix leak of HDMI EDID
diff mbox

Message ID 20170808205605.4432-1-eric@anholt.net
State New
Headers show

Commit Message

Eric Anholt Aug. 8, 2017, 8:56 p.m. UTC
We don't keep a pointer to it around anywhere, so it's our job to free
it.

Cc: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://github.com/anholt/linux/issues/101
Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.")
Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Vetter Aug. 9, 2017, 5:36 p.m. UTC | #1
On Tue, Aug 08, 2017 at 01:56:05PM -0700, Eric Anholt wrote:
> We don't keep a pointer to it around anywhere, so it's our job to free
> it.
> 
> Cc: Stefan Wahren <stefan.wahren@i2se.com>
> Link: https://github.com/anholt/linux/issues/101
> Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.")
> Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/vc4/vc4_hdmi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index ff09b8e2f9ee..937da8dd65b8 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -288,6 +288,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
>  	drm_mode_connector_update_edid_property(connector, edid);
>  	ret = drm_add_edid_modes(connector, edid);
>  	drm_edid_to_eld(connector, edid);
> +	kfree(edid);
>  
>  	return ret;
>  }
> -- 
> 2.13.3
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Stefan Wahren Aug. 11, 2017, 5:33 p.m. UTC | #2
> Eric Anholt <eric@anholt.net> hat am 8. August 2017 um 22:56 geschrieben:
> 
> 
> We don't keep a pointer to it around anywhere, so it's our job to free
> it.
> 
> Cc: Stefan Wahren <stefan.wahren@i2se.com>
> Link: https://github.com/anholt/linux/issues/101
> Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.")
> Signed-off-by: Eric Anholt <eric@anholt.net>

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Eric Anholt Aug. 14, 2017, 9:11 p.m. UTC | #3
Daniel Vetter <daniel@ffwll.ch> writes:

> On Tue, Aug 08, 2017 at 01:56:05PM -0700, Eric Anholt wrote:
>> We don't keep a pointer to it around anywhere, so it's our job to free
>> it.
>> 
>> Cc: Stefan Wahren <stefan.wahren@i2se.com>
>> Link: https://github.com/anholt/linux/issues/101
>> Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.")
>> Signed-off-by: Eric Anholt <eric@anholt.net>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Pushed.  Thanks!

Patch
diff mbox

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index ff09b8e2f9ee..937da8dd65b8 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -288,6 +288,7 @@  static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
 	drm_mode_connector_update_edid_property(connector, edid);
 	ret = drm_add_edid_modes(connector, edid);
 	drm_edid_to_eld(connector, edid);
+	kfree(edid);
 
 	return ret;
 }