aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-10-24 11:18:23 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2009-12-06 05:18:27 -0500
commit8546e3ce6e37c359979b69862442f94e0ef0e03b (patch)
tree6c4a3cbac72565a3de08c623cc29b787880c2e2a /drivers/video
parent87fbaf6aea142b01756bbea09461daee41d93c0b (diff)
fbdev: atafb - add palette register check
Add check if palette register number is in correct range for few drivers which miss it. The regno value comes indirectly from user space. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/atafb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index 37624f74e88b..b7687c55fe16 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -2242,6 +2242,9 @@ static int ext_setcolreg(unsigned int regno, unsigned int red,
2242 if (!external_vgaiobase) 2242 if (!external_vgaiobase)
2243 return 1; 2243 return 1;
2244 2244
2245 if (regno > 255)
2246 return 1;
2247
2245 switch (external_card_type) { 2248 switch (external_card_type) {
2246 case IS_VGA: 2249 case IS_VGA:
2247 OUTB(0x3c8, regno); 2250 OUTB(0x3c8, regno);