summaryrefslogtreecommitdiffstats
path: root/drivers/video/maxinefb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/maxinefb.c')
-rw-r--r--drivers/video/maxinefb.c3
1 files changed, 3 insertions, 0 deletions
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,
/* value to be written into the palette reg. */
unsigned long hw_colorvalue = 0;
+ if (regno > 255)
+ return 1;
+
red >>= 8; /* The cmap fields are 16 bits */
green >>= 8; /* wide, but the harware colormap */
blue >>= 8; /* registers are only 8 bits wide */