All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/7] drm/i915/sdvo: Check that we have space for the infoframe
Date: Tue, 9 Apr 2019 22:59:43 +0300	[thread overview]
Message-ID: <20190409195943.GY3888@intel.com> (raw)
In-Reply-To: <155483920296.26510.16603186123030550385@skylake-alporthouse-com>

On Tue, Apr 09, 2019 at 08:46:42PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2019-04-09 15:40:51)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Before we go writing the infoframe let's make sure we have
> > the space for it. Not that it really matters since the write
> > loop would just terminate early in that case.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_sdvo.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> > index 7f64352a3413..1e0102f1710f 100644
> > --- a/drivers/gpu/drm/i915/intel_sdvo.c
> > +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> > @@ -970,6 +970,9 @@ static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
> >                                   &hbuf_size, 1))
> >                 return false;
> >  
> > +       if (hbuf_size < length)
> > +               return false;
> > +
> 
> Maybe after reporting the hbuf_size and length in the following
> DRM_DEBUG_KMS?

Yes, that does seem more sensible. Avoids the off by one as well.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-09 19:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 14:40 [PATCH 0/7] drm/i915: Fix SDVO HDMI audio Ville Syrjala
2019-04-09 14:40 ` [PATCH 1/7] drm/i915/sdvo: Fix AVI infoframe TX rate readout Ville Syrjala
2019-04-09 21:16   ` Chris Wilson
2019-04-10 10:27     ` Ville Syrjälä
2019-04-09 14:40 ` [PATCH 2/7] drm/i915/sdvo: Implement proper HDMI audio support for SDVO Ville Syrjala
2019-04-09 14:40   ` Ville Syrjala
2019-04-09 20:00   ` Ville Syrjälä
2019-04-09 20:00     ` Ville Syrjälä
2019-06-06 14:43     ` Imre Deak
2019-06-06 14:43       ` [Intel-gfx] " Imre Deak
2019-04-09 14:40 ` [PATCH 3/7] drm/i915: Rename SDVO_AUDIO_ENABLE to HDMI_AUDIO_ENABLE Ville Syrjala
2019-04-09 21:32   ` Chris Wilson
2019-04-09 14:40 ` [PATCH 4/7] drm/i915/sdvo: Check that we have space for the infoframe Ville Syrjala
2019-04-09 19:46   ` Chris Wilson
2019-04-09 19:59     ` Ville Syrjälä [this message]
2019-04-09 21:08       ` Chris Wilson
2019-04-10 17:08   ` [PATCH v2 " Ville Syrjala
2019-04-22 18:37     ` Sripada, Radhakrishna
2019-04-23 14:34       ` Ville Syrjälä
2019-04-23 16:46         ` Sripada, Radhakrishna
2019-04-09 14:40 ` [PATCH 5/7] drm/i915/sdvo: Don't unpack stack garbage Ville Syrjala
2019-04-09 19:37   ` Chris Wilson
2019-04-09 14:40 ` [PATCH 6/7] drm/i915/sdvo: Don't write stack garbage into the hbuf Ville Syrjala
2019-04-09 19:39   ` Chris Wilson
2019-04-09 14:40 ` [PATCH 7/7] drm/i915/sdvo: Actually print the reason why the SDVO command failed Ville Syrjala
2019-04-09 19:44   ` Chris Wilson
2019-04-09 20:35     ` Ville Syrjälä
2019-04-10 17:09   ` [PATCH v2 " Ville Syrjala
2019-04-09 16:26 ` ✓ Fi.CI.BAT: success for drm/i915: Fix SDVO HDMI audio Patchwork
2019-04-10  2:52 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-04-10 19:35 ` ✓ Fi.CI.BAT: success for drm/i915: Fix SDVO HDMI audio (rev3) Patchwork
2019-04-11  5:46 ` ✗ Fi.CI.IGT: failure " 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=20190409195943.GY3888@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.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.