From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Cc: Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH] fbdev: Fix software blanking code
Date: Mon, 25 Oct 2004 05:48:59 +0800 [thread overview]
Message-ID: <200410250549.02808.adaplas@hotpop.com> (raw)
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);
reply other threads:[~2004-10-24 21:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200410250549.02808.adaplas@hotpop.com \
--to=adaplas@hotpop.com \
--cc=adaplas@pol.net \
--cc=akpm@osdl.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome