lkml.org 
[lkml]   [2004]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fbdev: Fix software blanking code
Date
The code in fbmem.c:fb_blank() is broken.  For drivers without an fb_blank
hook, an FBIO_BLANK ioctl will produce wrong colors or will segfault.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---
fbmem.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)

diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c 2004-10-17 15:03:25 +08:00
+++ b/drivers/video/fbmem.c 2004-10-25 05:45:24 +08:00
@@ -750,18 +750,20 @@

if (info->fbops->fb_blank && !info->fbops->fb_blank(blank, info))
return 0;
+
+ cmap = info->cmap;
+
if (blank) {
black = kmalloc(sizeof(u16) * info->cmap.len, GFP_KERNEL);
- if (!black) {
+ if (black) {
memset(black, 0, info->cmap.len * sizeof(u16));
cmap.red = cmap.green = cmap.blue = black;
cmap.transp = info->cmap.transp ? black : NULL;
cmap.start = info->cmap.start;
cmap.len = info->cmap.len;
}
- } else
- cmap = info->cmap;
-
+ }
+
err = fb_set_cmap(&cmap, info);
kfree(black);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.035 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site