From 60006d9ef11fd2cdc1b7699cb17dc281b2509b59 Mon Sep 17 00:00:00 2001 From: SteamOS Desktop Date: Tue, 17 Dec 2013 05:08:08 -0800 Subject: [PATCH] fbcon: Avoid corrupting active workqueue entries --- drivers/video/console/fbcon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index a92783e480e6..56869c65dac9 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -397,6 +397,8 @@ static void fb_flashcursor(struct work_struct *work) ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); console_unlock(); + + mod_timer(&ops->cursor_timer, jiffies + HZ/5); } static void cursor_timer_handler(unsigned long dev_addr) @@ -405,7 +407,6 @@ static void cursor_timer_handler(unsigned long dev_addr) struct fbcon_ops *ops = info->fbcon_par; schedule_work(&info->queue); - mod_timer(&ops->cursor_timer, jiffies + HZ/5); } static void fbcon_add_cursor_timer(struct fb_info *info) @@ -417,6 +418,8 @@ static void fbcon_add_cursor_timer(struct fb_info *info) !fbcon_cursor_noblink) { if (!info->queue.func) INIT_WORK(&info->queue, fb_flashcursor); + else + flush_work(&info->queue); init_timer(&ops->cursor_timer); ops->cursor_timer.function = cursor_timer_handler; @@ -433,6 +436,7 @@ static void fbcon_del_cursor_timer(struct fb_info *info) if (info->queue.func == fb_flashcursor && ops->flags & FBCON_FLAGS_CURSOR_TIMER) { + flush_work(&info->queue); del_timer_sync(&ops->cursor_timer); ops->flags &= ~FBCON_FLAGS_CURSOR_TIMER; } -- 1.8.5.1