Commit dd0314f7bb407bc4bdb3ea769b9c8a3a5d39ffd7

Authored by Antonino A. Daplas
Committed by Linus Torvalds
1 parent 3084a895c2

[PATCH] fbcon: Initialize new driver when old driver is released

If machine has more than 1 driver installed, and they all drive the same
hardware, it's possible that the driver's fb_release() method will attempt to
restore the hardware state to the initial state.  This will leave the new
driver in an undefined state.  To prevent this problem, initialize the new
driver by calling fb_set_par() when the old driver is released by fbcon.

Signed-off-by: Antonino Daplas<adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 9 additions and 0 deletions Side-by-side Diff

drivers/video/console/fbcon.c
... ... @@ -630,6 +630,15 @@
630 630 kfree(oldinfo->fbcon_par);
631 631 oldinfo->fbcon_par = NULL;
632 632 module_put(oldinfo->fbops->owner);
  633 + /*
  634 + If oldinfo and newinfo are driving the same hardware,
  635 + the fb_release() method of oldinfo may attempt to
  636 + restore the hardware state. This will leave the
  637 + newinfo in an undefined state. Thus, a call to
  638 + fb_set_par() may be needed for the newinfo.
  639 + */
  640 + if (newinfo->fbops->fb_set_par)
  641 + newinfo->fbops->fb_set_par(newinfo);
633 642 }
634 643  
635 644 return err;