提交 beaa4867 编写于 作者: G Geoff Levand 提交者: Linus Torvalds

fbcon: fix workqueue shutdown

Add a call to cancel_work_sync() in fbcon_exit() to cancel any pending
work in the fbcon workqueue.

The current implementation of fbcon_exit() sets the fbcon workqueue
function info->queue.func to NULL, but does not assure that there is no
work pending when it does so.  On occasion, depending on system timing,
there will still be pending work in the queue when fbcon_exit() is
called.  This results in a null pointer deference when run_workqueue()
tries to call the queue's work function.

Fixes errors on shutdown similar to these:

  Console: switching to colour dummy device 80x25
  Unable to handle kernel paging request for data at address 0x00000000
Signed-off-by: NGeoff Levand <geoffrey.levand@am.sony.com>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6841c8e2
...@@ -3531,12 +3531,18 @@ static void fbcon_exit(void) ...@@ -3531,12 +3531,18 @@ static void fbcon_exit(void)
softback_buf = 0UL; softback_buf = 0UL;
for (i = 0; i < FB_MAX; i++) { for (i = 0; i < FB_MAX; i++) {
int pending;
mapped = 0; mapped = 0;
info = registered_fb[i]; info = registered_fb[i];
if (info == NULL) if (info == NULL)
continue; continue;
pending = cancel_work_sync(&info->queue);
DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
"no"));
for (j = first_fb_vc; j <= last_fb_vc; j++) { for (j = first_fb_vc; j <= last_fb_vc; j++) {
if (con2fb_map[j] == i) if (con2fb_map[j] == i)
mapped = 1; mapped = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册