diff options
-rw-r--r-- | drivers/video/atafb.c | 3 | ||||
-rw-r--r-- | drivers/video/ep93xx-fb.c | 2 | ||||
-rw-r--r-- | drivers/video/maxinefb.c | 3 | ||||
-rw-r--r-- | drivers/video/pmag-ba-fb.c | 3 | ||||
-rw-r--r-- | drivers/video/pmagb-b-fb.c | 3 |
5 files changed, 12 insertions, 2 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index b7687c55fe16..2051c9dc813b 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
@@ -2245,6 +2245,9 @@ static int ext_setcolreg(unsigned int regno, unsigned int red, | |||
2245 | if (regno > 255) | 2245 | if (regno > 255) |
2246 | return 1; | 2246 | return 1; |
2247 | 2247 | ||
2248 | if (regno > 255) | ||
2249 | return 1; | ||
2250 | |||
2248 | switch (external_card_type) { | 2251 | switch (external_card_type) { |
2249 | case IS_VGA: | 2252 | case IS_VGA: |
2250 | OUTB(0x3c8, regno); | 2253 | OUTB(0x3c8, regno); |
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c index bd9d46f95291..27aab4a06198 100644 --- a/drivers/video/ep93xx-fb.c +++ b/drivers/video/ep93xx-fb.c | |||
@@ -358,6 +358,8 @@ static int ep93xxfb_setcolreg(unsigned int regno, unsigned int red, | |||
358 | 358 | ||
359 | switch (info->fix.visual) { | 359 | switch (info->fix.visual) { |
360 | case FB_VISUAL_PSEUDOCOLOR: | 360 | case FB_VISUAL_PSEUDOCOLOR: |
361 | if (regno > 255) | ||
362 | return 1; | ||
361 | rgb = ((red & 0xff00) << 8) | (green & 0xff00) | | 363 | rgb = ((red & 0xff00) << 8) | (green & 0xff00) | |
362 | ((blue & 0xff00) >> 8); | 364 | ((blue & 0xff00) >> 8); |
363 | 365 | ||
diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c index 5e91c2b30af9..7854c7a37dc5 100644 --- a/drivers/video/maxinefb.c +++ b/drivers/video/maxinefb.c | |||
@@ -92,6 +92,9 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
92 | /* value to be written into the palette reg. */ | 92 | /* value to be written into the palette reg. */ |
93 | unsigned long hw_colorvalue = 0; | 93 | unsigned long hw_colorvalue = 0; |
94 | 94 | ||
95 | if (regno > 255) | ||
96 | return 1; | ||
97 | |||
95 | red >>= 8; /* The cmap fields are 16 bits */ | 98 | red >>= 8; /* The cmap fields are 16 bits */ |
96 | green >>= 8; /* wide, but the harware colormap */ | 99 | green >>= 8; /* wide, but the harware colormap */ |
97 | blue >>= 8; /* registers are only 8 bits wide */ | 100 | blue >>= 8; /* registers are only 8 bits wide */ |
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index 0573ec685a57..0f361b6100d2 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c | |||
@@ -98,7 +98,8 @@ static int pmagbafb_setcolreg(unsigned int regno, unsigned int red, | |||
98 | { | 98 | { |
99 | struct pmagbafb_par *par = info->par; | 99 | struct pmagbafb_par *par = info->par; |
100 | 100 | ||
101 | BUG_ON(regno >= info->cmap.len); | 101 | if (regno >= info->cmap.len) |
102 | return 1; | ||
102 | 103 | ||
103 | red >>= 8; /* The cmap fields are 16 bits */ | 104 | red >>= 8; /* The cmap fields are 16 bits */ |
104 | green >>= 8; /* wide, but the hardware colormap */ | 105 | green >>= 8; /* wide, but the hardware colormap */ |
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 98748723af9f..2de0806421b4 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c | |||
@@ -102,7 +102,8 @@ static int pmagbbfb_setcolreg(unsigned int regno, unsigned int red, | |||
102 | { | 102 | { |
103 | struct pmagbbfb_par *par = info->par; | 103 | struct pmagbbfb_par *par = info->par; |
104 | 104 | ||
105 | BUG_ON(regno >= info->cmap.len); | 105 | if (regno >= info->cmap.len) |
106 | return 1; | ||
106 | 107 | ||
107 | red >>= 8; /* The cmap fields are 16 bits */ | 108 | red >>= 8; /* The cmap fields are 16 bits */ |
108 | green >>= 8; /* wide, but the hardware colormap */ | 109 | green >>= 8; /* wide, but the hardware colormap */ |