From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@ffwll.ch>,
stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/4] drm/i915: Don't leak edid in intel_crt_detect_ddc()
Date: Fri, 20 Jan 2017 17:02:39 +0200 [thread overview]
Message-ID: <20170120150239.GH31595@intel.com> (raw)
In-Reply-To: <1484922525-6131-1-git-send-email-ander.conselvan.de.oliveira@intel.com>
On Fri, Jan 20, 2017 at 04:28:42PM +0200, Ander Conselvan de Oliveira wrote:
> In the path where intel_crt_detect_ddc() detects a CRT, if would return
> true without freeing the edid.
>
> Found by coverity.
>
> Fixes: a2bd1f541f19 ("drm/i915: check whether we actually received an
> edid in detect_ddc")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v3.6+
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_crt.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 385e29a..2bf5aca 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -499,6 +499,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
> struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev);
> struct edid *edid;
> struct i2c_adapter *i2c;
> + bool ret = false;
>
> BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG);
>
> @@ -515,17 +516,17 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
> */
> if (!is_digital) {
> DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
> - return true;
> + ret = true;
> + } else {
> + DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
> }
> -
> - DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
> } else {
> DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n");
> }
>
> kfree(edid);
>
> - return false;
> + return ret;
> }
>
> static enum drm_connector_status
> --
> 2.5.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@ffwll.ch>,
stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/4] drm/i915: Don't leak edid in intel_crt_detect_ddc()
Date: Fri, 20 Jan 2017 17:02:39 +0200 [thread overview]
Message-ID: <20170120150239.GH31595@intel.com> (raw)
In-Reply-To: <1484922525-6131-1-git-send-email-ander.conselvan.de.oliveira@intel.com>
On Fri, Jan 20, 2017 at 04:28:42PM +0200, Ander Conselvan de Oliveira wrote:
> In the path where intel_crt_detect_ddc() detects a CRT, if would return
> true without freeing the edid.
>
> Found by coverity.
>
> Fixes: a2bd1f541f19 ("drm/i915: check whether we actually received an
> edid in detect_ddc")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v3.6+
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_crt.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 385e29a..2bf5aca 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -499,6 +499,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
> struct drm_i915_private *dev_priv = to_i915(crt->base.base.dev);
> struct edid *edid;
> struct i2c_adapter *i2c;
> + bool ret = false;
>
> BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG);
>
> @@ -515,17 +516,17 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector)
> */
> if (!is_digital) {
> DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n");
> - return true;
> + ret = true;
> + } else {
> + DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
> }
> -
> - DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
> } else {
> DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n");
> }
>
> kfree(edid);
>
> - return false;
> + return ret;
> }
>
> static enum drm_connector_status
> --
> 2.5.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrj�l�
Intel OTC
next prev parent reply other threads:[~2017-01-20 15:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 14:28 [PATCH 1/4] drm/i915: Don't leak edid in intel_crt_detect_ddc() Ander Conselvan de Oliveira
2017-01-20 14:28 ` Ander Conselvan de Oliveira
2017-01-20 14:28 ` [PATCH 2/4] drm/i915: Don't init hpd polling for vlv and chv from runtime_suspend() Ander Conselvan de Oliveira
2017-01-20 14:28 ` Ander Conselvan de Oliveira
2017-01-20 14:58 ` Ville Syrjälä
2017-01-20 14:58 ` Ville Syrjälä
2017-01-20 14:28 ` [PATCH 3/4] drm/i915: Fix calculation of rotated x and y offsets for planar formats Ander Conselvan de Oliveira
2017-01-20 14:28 ` Ander Conselvan de Oliveira
2017-01-20 15:00 ` Ville Syrjälä
2017-01-20 15:00 ` Ville Syrjälä
2017-01-20 14:28 ` [PATCH 4/4] drm/i915: Check for NULL atomic state in intel_crtc_disable_noatomic() Ander Conselvan de Oliveira
2017-01-20 14:28 ` Ander Conselvan de Oliveira
2017-01-20 15:01 ` [Intel-gfx] " Ville Syrjälä
2017-01-20 15:01 ` Ville Syrjälä
2017-01-20 14:51 ` [PATCH] drm/i915/crt: Keep the EDID for the whole detect cycle Chris Wilson
2017-01-20 14:54 ` ✗ Fi.CI.BAT: warning for series starting with [1/4] drm/i915: Don't leak edid in intel_crt_detect_ddc() Patchwork
2017-01-23 8:40 ` Ander Conselvan De Oliveira
2017-01-20 15:02 ` Ville Syrjälä [this message]
2017-01-20 15:02 ` [Intel-gfx] [PATCH 1/4] " Ville Syrjälä
2017-01-20 15:09 ` Jani Nikula
2017-01-20 15:09 ` Jani Nikula
2017-01-20 15:54 ` ✗ Fi.CI.BAT: failure for series starting with drm/i915/crt: Keep the EDID for the whole detect cycle (rev2) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170120150239.GH31595@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ander.conselvan.de.oliveira@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.