Skip to content

Commit

Permalink
atyfb: correct_chipset() can fail
Browse files Browse the repository at this point in the history
Atari probe code relies on correct_chipset() failing if the device is not
a mach64 GX/CX.  aty_chips[] array would be indexed with -1 in that case.

Signed-off-by: Ville Syrjala <syrjala@sci.fi>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ville Syrjala authored and Linus Torvalds committed Jul 24, 2008
1 parent 50cd022 commit 3880b0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ static struct {
#endif /* CONFIG_FB_ATY_CT */
};

/* can not fail */
static int __devinit correct_chipset(struct atyfb_par *par)
{
u8 rev;
Expand All @@ -437,6 +436,9 @@ static int __devinit correct_chipset(struct atyfb_par *par)
if (par->pci_id == aty_chips[i].pci_id)
break;

if (i < 0)
return -ENODEV;

name = aty_chips[i].name;
par->pll_limits.pll_max = aty_chips[i].pll;
par->pll_limits.mclk = aty_chips[i].mclk;
Expand Down

0 comments on commit 3880b0b

Please sign in to comment.