Commit c771eba1 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

fm2fb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4a1b9279
...@@ -195,13 +195,15 @@ static int fm2fb_blank(int blank, struct fb_info *info) ...@@ -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, static int fm2fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info) u_int transp, struct fb_info *info)
{ {
if (regno > info->cmap.len) if (regno < 16) {
return 1;
red >>= 8; red >>= 8;
green >>= 8; green >>= 8;
blue >>= 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; return 0;
} }
...@@ -237,7 +239,7 @@ static int __devinit fm2fb_probe(struct zorro_dev *z, ...@@ -237,7 +239,7 @@ static int __devinit fm2fb_probe(struct zorro_dev *z,
if (!zorro_request_device(z,"fm2fb")) if (!zorro_request_device(z,"fm2fb"))
return -ENXIO; return -ENXIO;
info = framebuffer_alloc(256 * sizeof(u32), &z->dev); info = framebuffer_alloc(16 * sizeof(u32), &z->dev);
if (!info) { if (!info) {
zorro_release_device(z); zorro_release_device(z);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment