fbcon: fix race condition between console lock and cursor timer
Changes
1 files changed · +5 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| drivers/video/console/fbcon.c | modified | +5 | −1 | View file |
drivers/video/console/fbcon.c
View filediff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 2e471c2..f8a79fc 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -372,8 +372,12 @@ static void fb_flashcursor(struct work_struct *work)
struct vc_data *vc = NULL;
int c;
int mode;
+ int ret;
+
+ ret = console_trylock();
+ if (ret == 0)
+ return;
- console_lock();
if (ops && ops->currcon != -1)
vc = vc_cons[ops->currcon].d;