LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drm/bridge: vga-dac: Fix edid memory leak
@ 2018-04-20 18:59 Sean Paul
  2018-04-21  8:47 ` Laurent Pinchart
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sean Paul @ 2018-04-20 18:59 UTC (permalink / raw)
  To: dri-devel
  Cc: Sean Paul, Rob Herring, Maxime Ripard, Archit Taneja,
	Andrzej Hajda, Laurent Pinchart, stable, David Airlie,
	linux-kernel

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

Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support")
Cc: Rob Herring <robh@kernel.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/bridge: vga-dac: Fix edid memory leak
  2018-04-20 18:59 [PATCH] drm/bridge: vga-dac: Fix edid memory leak Sean Paul
@ 2018-04-21  8:47 ` Laurent Pinchart
  2018-04-23  7:01 ` Maxime Ripard
  2018-05-02 19:36 ` Sean Paul
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2018-04-21  8:47 UTC (permalink / raw)
  To: Sean Paul
  Cc: dri-devel, Rob Herring, Maxime Ripard, Archit Taneja,
	Andrzej Hajda, stable, David Airlie, linux-kernel

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 <robh@kernel.org>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: <stable@vger.kernel.org> # v4.9+
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/bridge: vga-dac: Fix edid memory leak
  2018-04-20 18:59 [PATCH] drm/bridge: vga-dac: Fix edid memory leak Sean Paul
  2018-04-21  8:47 ` Laurent Pinchart
@ 2018-04-23  7:01 ` Maxime Ripard
  2018-05-02 19:36 ` Sean Paul
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2018-04-23  7:01 UTC (permalink / raw)
  To: Sean Paul
  Cc: dri-devel, Rob Herring, Archit Taneja, Andrzej Hajda,
	Laurent Pinchart, stable, David Airlie, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

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 <robh@kernel.org>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: <stable@vger.kernel.org> # v4.9+
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>

Maxime

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/bridge: vga-dac: Fix edid memory leak
  2018-04-20 18:59 [PATCH] drm/bridge: vga-dac: Fix edid memory leak Sean Paul
  2018-04-21  8:47 ` Laurent Pinchart
  2018-04-23  7:01 ` Maxime Ripard
@ 2018-05-02 19:36 ` Sean Paul
  2 siblings, 0 replies; 4+ messages in thread
From: Sean Paul @ 2018-05-02 19:36 UTC (permalink / raw)
  To: dri-devel
  Cc: Sean Paul, Rob Herring, Maxime Ripard, Archit Taneja,
	Andrzej Hajda, Laurent Pinchart, stable, David Airlie,
	linux-kernel

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 <robh@kernel.org>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: <stable@vger.kernel.org> # v4.9+
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-02 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20 18:59 [PATCH] drm/bridge: vga-dac: Fix edid memory leak Sean Paul
2018-04-21  8:47 ` Laurent Pinchart
2018-04-23  7:01 ` Maxime Ripard
2018-05-02 19:36 ` Sean Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).