Re: drivers/ide/pci/cs5535.c: array overrun

Bartlomiej Zolnierkiewicz
2007-07-26T20:00:01Z

Hi,

On Tuesday 24 July 2007, Jordan Crouse wrote:
> > The Coverity checker spotted the following array overrun in
> > drivers/ide/pci/cs5535.c:
>
> <-- snip -->
>
> > if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_7)
> > reg |= cs5535_udma_timings[speed - XFER_UDMA_0];

Not a bug per se since the upper layer will never feed this function
with speed > XFER_UDMA_4 (thanks to ->ultra_mask being set to 0x1f).

Worth fixing anyway.

> Fix is attached. Somebody got overzealous - the 5535 only supports
> up to UDMA4, which matches the array.

applied, thanks

Bart