2018-04-20 19:03:37

by Sean Paul

[permalink] [raw]
Subject: [PATCH] drm/bridge: vga-dac: Fix edid memory leak

edid should be freed once it's finished being used.

Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support")
Cc: Rob Herring <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Archit Taneja <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: <[email protected]> # v4.9+
Signed-off-by: Sean Paul <[email protected]>
---
drivers/gpu/drm/bridge/dumb-vga-dac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c
index 498d5948d1a8..9837c8d69e69 100644
--- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
+++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
@@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector *connector)
}

drm_mode_connector_update_edid_property(connector, edid);
- return drm_add_edid_modes(connector, edid);
+ ret = drm_add_edid_modes(connector, edid);
+ kfree(edid);
+ return ret;

fallback:
/*
--
Sean Paul, Software Engineer, Google / Chromium OS



2018-04-21 08:51:19

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH] drm/bridge: vga-dac: Fix edid memory leak

Hi Sean,

Thank you for the patch.

On Friday, 20 April 2018 21:59:59 EEST Sean Paul wrote:
> edid should be freed once it's finished being used.
>
> Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support")
> Cc: Rob Herring <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Archit Taneja <[email protected]>
> Cc: Andrzej Hajda <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: <[email protected]> # v4.9+
> Signed-off-by: Sean Paul <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
> drivers/gpu/drm/bridge/dumb-vga-dac.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> b/drivers/gpu/drm/bridge/dumb-vga-dac.c index 498d5948d1a8..9837c8d69e69
> 100644
> --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
> @@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector
> *connector) }
>
> drm_mode_connector_update_edid_property(connector, edid);
> - return drm_add_edid_modes(connector, edid);
> + ret = drm_add_edid_modes(connector, edid);
> + kfree(edid);
> + return ret;
>
> fallback:
> /*

--
Regards,

Laurent Pinchart




2018-04-23 07:03:03

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH] drm/bridge: vga-dac: Fix edid memory leak

On Fri, Apr 20, 2018 at 02:59:59PM -0400, Sean Paul wrote:
> edid should be freed once it's finished being used.
>
> Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support")
> Cc: Rob Herring <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Archit Taneja <[email protected]>
> Cc: Andrzej Hajda <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: <[email protected]> # v4.9+
> Signed-off-by: Sean Paul <[email protected]>

Reviewed-by: Maxime Ripard <[email protected]>

Maxime

--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (748.00 B)
signature.asc (849.00 B)
Download all attachments

2018-05-02 19:37:18

by Sean Paul

[permalink] [raw]
Subject: Re: [PATCH] drm/bridge: vga-dac: Fix edid memory leak

On Fri, Apr 20, 2018 at 02:59:59PM -0400, Sean Paul wrote:
> edid should be freed once it's finished being used.
>
> Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support")
> Cc: Rob Herring <[email protected]>
> Cc: Sean Paul <[email protected]>
> Cc: Maxime Ripard <[email protected]>
> Cc: Archit Taneja <[email protected]>
> Cc: Andrzej Hajda <[email protected]>
> Cc: Laurent Pinchart <[email protected]>
> Cc: <[email protected]> # v4.9+
> Signed-off-by: Sean Paul <[email protected]>

Applied to -misc-fixes with review tags.

Sean

> ---
> drivers/gpu/drm/bridge/dumb-vga-dac.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c
> index 498d5948d1a8..9837c8d69e69 100644
> --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
> @@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector *connector)
> }
>
> drm_mode_connector_update_edid_property(connector, edid);
> - return drm_add_edid_modes(connector, edid);
> + ret = drm_add_edid_modes(connector, edid);
> + kfree(edid);
> + return ret;
>
> fallback:
> /*
> --
> Sean Paul, Software Engineer, Google / Chromium OS
>

--
Sean Paul, Software Engineer, Google / Chromium OS