[FB PATCH] fix alpha boot oops

Richard Henderson (rth@twiddle.net)
Mon, 6 Jan 2003 01:20:42 -0800


Oops in fb_set_cmap caused by palette_cmap.transp uninitialized.
By inspection, fb_blank appears to have the same problem.

r~

===== fbmem.c 1.49 vs edited =====
--- 1.49/drivers/video/fbmem.c Tue Dec 31 18:08:48 2002
+++ edited/fbmem.c Mon Jan 6 01:07:03 2003
@@ -386,6 +386,7 @@
palette_cmap.red = palette_red;
palette_cmap.green = palette_green;
palette_cmap.blue = palette_blue;
+ palette_cmap.transp = NULL;

for (i = 0; i < LINUX_LOGO_COLORS; i += n) {
n = LINUX_LOGO_COLORS - i;
@@ -767,6 +768,7 @@
int
fb_blank(int blank, struct fb_info *info)
{
+ /* ??? Varible sized stack allocation. */
u16 black[info->cmap.len];
struct fb_cmap cmap;

@@ -775,8 +777,7 @@
if (blank) {
memset(black, 0, info->cmap.len * sizeof(u16));
cmap.red = cmap.green = cmap.blue = black;
- if (info->cmap.transp)
- cmap.transp = black;
+ cmap.transp = info->cmap.transp ? black : NULL;
cmap.start = info->cmap.start;
cmap.len = info->cmap.len;
} else
-
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/