aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/aty
diff options
context:
space:
mode:
authorVille Syrjala <syrjala@sci.fi>2008-07-23 21:31:30 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 10:47:39 -0700
commit3880b0b5297ae9bf58a7662d13a46b5d5f0b2af6 (patch)
treef450fe9d753da590357f9f80a8a6bf2ed63127c6 /drivers/video/aty
parent50cd0221c9062ec5dac8a3620f36f568df052ac1 (diff)
atyfb: correct_chipset() can fail
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>
Diffstat (limited to 'drivers/video/aty')
-rw-r--r--drivers/video/aty/atyfb_base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index d7ba3f1a4d8..d6903c70bee 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -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;
@@ -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;