Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4941cb7a authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds
Browse files

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: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 38b4982c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;