lkml.org 
[lkml]   [2004]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fbdev: Fix crash if fb_set_var() called before register_framebuffer()
Date
The field info->modelist is initialized during register_framebuffer.  This
field is also referred to in fb_set_var(). Thus a call to fb_set_var()
before register_framebuffer() will cause a crash. A few drivers do this,
notably controlfb. (This might fix reports of controlfb crashing in
powermacs).

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---

fbmem.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)

diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c 2004-11-23 21:20:13 +08:00
+++ b/drivers/video/fbmem.c 2004-11-25 01:09:22 +08:00
@@ -725,7 +725,10 @@
fb_set_cmap(&info->cmap, info);

fb_var_to_videomode(&mode, &info->var);
- fb_add_videomode(&mode, &info->modelist);
+
+ if (info->modelist.prev && info->modelist.next &&
+ !list_empty(&info->modelist))
+ fb_add_videomode(&mode, &info->modelist);

if (info->flags & FBINFO_MISC_MODECHANGEUSER) {
struct fb_event event;



-
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:08    [W:0.048 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site