linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: bzolnier@gmail.com
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: drivers/ide/pci/cs5535.c: array overrun
Date: Tue, 24 Jul 2007 14:45:24 +0200	[thread overview]
Message-ID: <20070724124524.GA6019@stusta.de> (raw)

The Coverity checker spotted the following array overrun in 
drivers/ide/pci/cs5535.c:

<--  snip  -->

...
static unsigned int cs5535_udma_timings[5] =
{ 0x7F7436A1, 0x7F733481, 0x7F723261, 0x7F713161, 0x7F703061 };
...
static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
{
...
                if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_7)
                        reg |= cs5535_udma_timings[speed - XFER_UDMA_0];
...

<--  snip  -->

XFER_UDMA_7 - XFER_UDMA_0 = 7  >  (5 - 1)

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


             reply	other threads:[~2007-07-24 12:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <06FDA0246543E443ABBB36B1FCD5CC0603CF3360@SAUSEXMB2.amd.com>
2007-07-24 12:45 ` Adrian Bunk [this message]
2007-07-24 15:59   ` drivers/ide/pci/cs5535.c: array overrun Jordan Crouse
2007-07-26 19:11     ` Bartlomiej Zolnierkiewicz

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=20070724124524.GA6019@stusta.de \
    --to=bunk@stusta.de \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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 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).