Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[safe/jmp/linux-2.6] / drivers / video / ep93xx-fb.c
index bd9d46f..0c99de0 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/slab.h>
 #include <linux/clk.h>
 #include <linux/fb.h>
 
@@ -358,6 +359,8 @@ static int ep93xxfb_setcolreg(unsigned int regno, unsigned int red,
 
        switch (info->fix.visual) {
        case FB_VISUAL_PSEUDOCOLOR:
+               if (regno > 255)
+                       return 1;
                rgb = ((red & 0xff00) << 8) | (green & 0xff00) |
                        ((blue & 0xff00) >> 8);