diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-10-24 19:18:23 +0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2009-12-06 13:18:27 +0300 |
commit | 8546e3ce6e37c359979b69862442f94e0ef0e03b (patch) | |
tree | 6c4a3cbac72565a3de08c623cc29b787880c2e2a | |
parent | 87fbaf6aea142b01756bbea09461daee41d93c0b (diff) | |
download | linux-8546e3ce6e37c359979b69862442f94e0ef0e03b.tar.xz |
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>
-rw-r--r-- | drivers/video/atafb.c | 3 |
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, if (!external_vgaiobase) return 1; + if (regno > 255) + return 1; + switch (external_card_type) { case IS_VGA: OUTB(0x3c8, regno); |