Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c771eba1fe7168d6f2cbc52efa55b3838bd05b05
Commit:     c771eba1fe7168d6f2cbc52efa55b3838bd05b05
Parent:     4a1b92793a0824d31f165fe3a97634dbb9a3ae18
Author:     Antonino A. Daplas <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 17 04:05:36 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jul 17 10:23:12 2007 -0700

    fm2fb: the pseudo_palette is only 16 elements long
    
    The pseudo_palette is only 16 elements long.
    
    Signed-off-by: Antonino Daplas <[EMAIL PROTECTED]>
    Acked-by: Geert Uytterhoeven <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/video/fm2fb.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c
index 70ff55b..6c91c61 100644
--- a/drivers/video/fm2fb.c
+++ b/drivers/video/fm2fb.c
@@ -195,13 +195,15 @@ static int fm2fb_blank(int blank, struct fb_info *info)
 static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
                          u_int transp, struct fb_info *info)
 {
-       if (regno > info->cmap.len)
-               return 1;
-       red >>= 8;
-       green >>= 8;
-       blue >>= 8;
+       if (regno < 16) {
+               red >>= 8;
+               green >>= 8;
+               blue >>= 8;
+
+               ((u32*)(info->pseudo_palette))[regno] = (red << 16) |
+                       (green << 8) | blue;
+       }
 
-       ((u32*)(info->pseudo_palette))[regno] = (red << 16) | (green << 8) | 
blue;
        return 0;
 }
 
@@ -237,7 +239,7 @@ static int __devinit fm2fb_probe(struct zorro_dev *z,
        if (!zorro_request_device(z,"fm2fb"))
                return -ENXIO;
 
-       info = framebuffer_alloc(256 * sizeof(u32), &z->dev);
+       info = framebuffer_alloc(16 * sizeof(u32), &z->dev);
        if (!info) {
                zorro_release_device(z);
                return -ENOMEM;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to