]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fbcon: only unbind from console if successfully registered
authorIan Armstrong <ian@iarmst.demon.co.uk>
Tue, 22 Sep 2009 23:47:52 +0000 (16:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:31:36 +0000 (09:31 -0700)
commita1ae2307df3270ecf3fb15786aebc1d72493e960
treec7ef81b46a36a6d01acaf2e743a8bb5ae82d82a7
parentf85b6ef18e1429ed53cc8860334aebad542939b7
fbcon: only unbind from console if successfully registered

commit 2ddce3fd0acbdc1be684fb5f919ae3d2e9518aac upstream.

Attempting to unload a framebuffer module calls unregister_framebuffer()
which in turn gets fbcon to release it.  If fbcon has no framebuffers
linked to a console, it will also unbind itself from the console driver.
However, if fbcon never registered itself as a console driver, the unbind
will fail causing the framebuffer device entry to persist.  In most cases
this failure will result in an oops when attempting to access the now
non-existent device.

This patch ensures that the fbcon unbind request will succeed even if a
bind was never done.  It tracks if a successful bind ever occurred & will
only attempt to unbind if needed.  If there never was a bind, it simply
returns with no error.

Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/video/console/fbcon.c