linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: "Dan Carpenter" <error27@gmail.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Alex Deucher" <alexdeucher@gmail.com>,
	"Jerome Glisse" <jglisse@redhat.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	dri-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [patch] radeon: range check issues
Date: Wed, 31 Mar 2010 23:43:23 -0400	[thread overview]
Message-ID: <g2ga728f9f91003312043z40b3dfb4ud6699b468860cb60@mail.gmail.com> (raw)
In-Reply-To: <20100328112309.GJ5069@bicker>

On Sun, Mar 28, 2010 at 7:23 AM, Dan Carpenter <error27@gmail.com> wrote:
> This change makes the array larger, "MAX_SUPPORTED_TV_TIMING_V1_2" is 3
> and the original size "MAX_SUPPORTED_TV_TIMING" is 2.
>
> Also there were checks that were off by one.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> Compile tested only.  Changing the array size seemed like the right
> thing to do, in the context, but please review carefully.

That patch is correct and corresponds to the actual table sizes in the vbios.

Alex


>
> diff --git a/drivers/gpu/drm/radeon/atombios.h b/drivers/gpu/drm/radeon/atombios.h
> index 6732b5d..27e2c71 100644
> --- a/drivers/gpu/drm/radeon/atombios.h
> +++ b/drivers/gpu/drm/radeon/atombios.h
> @@ -2912,7 +2912,7 @@ typedef struct _ATOM_ANALOG_TV_INFO_V1_2
>   UCHAR                    ucTV_BootUpDefaultStandard;
>   UCHAR                    ucExt_TV_ASIC_ID;
>   UCHAR                    ucExt_TV_ASIC_SlaveAddr;
> -  ATOM_DTD_FORMAT          aModeTimings[MAX_SUPPORTED_TV_TIMING];
> +  ATOM_DTD_FORMAT          aModeTimings[MAX_SUPPORTED_TV_TIMING_V1_2];
>  }ATOM_ANALOG_TV_INFO_V1_2;
>
>  typedef struct _ATOM_DPCD_INFO
> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
> index 93783b1..bdc0ab3 100644
> --- a/drivers/gpu/drm/radeon/radeon_atombios.c
> +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
> @@ -1275,7 +1275,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
>        switch (crev) {
>        case 1:
>                tv_info = (ATOM_ANALOG_TV_INFO *)(mode_info->atom_context->bios + data_offset);
> -               if (index > MAX_SUPPORTED_TV_TIMING)
> +               if (index >= MAX_SUPPORTED_TV_TIMING)
>                        return false;
>
>                mode->crtc_htotal = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Total);
> @@ -1313,7 +1313,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
>                break;
>        case 2:
>                tv_info_v1_2 = (ATOM_ANALOG_TV_INFO_V1_2 *)(mode_info->atom_context->bios + data_offset);
> -               if (index > MAX_SUPPORTED_TV_TIMING_V1_2)
> +               if (index >= MAX_SUPPORTED_TV_TIMING_V1_2)
>                        return false;
>
>                dtd_timings = &tv_info_v1_2->aModeTimings[index];
>
>

      reply	other threads:[~2010-04-01  3:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28 11:23 [patch] radeon: range check issues Dan Carpenter
2010-04-01  3:43 ` Alex Deucher [this message]

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=g2ga728f9f91003312043z40b3dfb4ud6699b468860cb60@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=error27@gmail.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zajec5@gmail.com \
    /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 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).