Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Antonino A. Daplas and committed by
Linus Torvalds
4941cb7a 38b4982c

+3 -1
+3 -1
drivers/video/fbmem.c
··· 803 803 804 804 if ((var->activate & FB_ACTIVATE_FORCE) || 805 805 memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) { 806 + u32 activate = var->activate; 807 + 806 808 if (!info->fbops->fb_check_var) { 807 809 *var = info->var; 808 810 return 0; ··· 833 831 834 832 if (!err && (flags & FBINFO_MISC_USEREVENT)) { 835 833 struct fb_event event; 836 - int evnt = (var->activate & FB_ACTIVATE_ALL) ? 834 + int evnt = (activate & FB_ACTIVATE_ALL) ? 837 835 FB_EVENT_MODE_CHANGE_ALL : 838 836 FB_EVENT_MODE_CHANGE; 839 837