diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2007-05-08 09:39:22 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 20:15:31 +0200 |
commit | 4941cb7a18fd84d4d8cd097d2beada3c79c8f781 (patch) | |
tree | 0f7419539b1d056da12b1124e0a33992a3a00432 /drivers/video/fbmem.c | |
parent | fbcon: check if the character count can be handled (diff) | |
download | linux-4941cb7a18fd84d4d8cd097d2beada3c79c8f781.tar.xz linux-4941cb7a18fd84d4d8cd097d2beada3c79c8f781.zip |
fbdev: save the activate field before calling fb_check_var()
Some drivers may reset the var->activate field on fb_check_var(). This can
lead to undefined behavior. For example, doing fbset -a <option> with vga16fb
will only modify the active console instead of modifying all.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index c4ce3e44327e..cd1407921af5 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -803,6 +803,8 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) if ((var->activate & FB_ACTIVATE_FORCE) || memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) { + u32 activate = var->activate; + if (!info->fbops->fb_check_var) { *var = info->var; return 0; @@ -831,7 +833,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) if (!err && (flags & FBINFO_MISC_USEREVENT)) { struct fb_event event; - int evnt = (var->activate & FB_ACTIVATE_ALL) ? + int evnt = (activate & FB_ACTIVATE_ALL) ? FB_EVENT_MODE_CHANGE_ALL : FB_EVENT_MODE_CHANGE; |