diff options
author | Andrea Righi <righi.andrea@gmail.com> | 2009-04-13 17:39:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-13 18:04:28 -0400 |
commit | 513adb58685615b0b1d47a3f0d40f5352beff189 (patch) | |
tree | 80afe08d17f24bbf3d5ad48d62df2e143d00ae95 /drivers/video/backlight | |
parent | b52bb3712a64c404846f30300b339cfd01e316be (diff) |
fbdev: fix info->lock deadlock in fbcon_event_notify()
fb_notifier_call_chain() is called with info->lock held, i.e. in
do_fb_ioctl() => FBIOPUT_VSCREENINFO => fb_set_var() and the some
notifier callbacks, like fbcon_event_notify(), try to re-acquire
info->lock again.
Remove the lock/unlock_fb_info() in all the framebuffer notifier
callbacks' and be sure to always call fb_notifier_call_chain() with
info->lock held.
Reported-by: Pavel Roskin <proski@gnu.org>
Reported-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/backlight.c | 3 | ||||
-rw-r--r-- | drivers/video/backlight/lcd.c | 3 |
2 files changed, 0 insertions, 6 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index dd37cbcaf8ce..157057c79ca3 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -35,8 +35,6 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
35 | return 0; | 35 | return 0; |
36 | 36 | ||
37 | bd = container_of(self, struct backlight_device, fb_notif); | 37 | bd = container_of(self, struct backlight_device, fb_notif); |
38 | if (!lock_fb_info(evdata->info)) | ||
39 | return -ENODEV; | ||
40 | mutex_lock(&bd->ops_lock); | 38 | mutex_lock(&bd->ops_lock); |
41 | if (bd->ops) | 39 | if (bd->ops) |
42 | if (!bd->ops->check_fb || | 40 | if (!bd->ops->check_fb || |
@@ -49,7 +47,6 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
49 | backlight_update_status(bd); | 47 | backlight_update_status(bd); |
50 | } | 48 | } |
51 | mutex_unlock(&bd->ops_lock); | 49 | mutex_unlock(&bd->ops_lock); |
52 | unlock_fb_info(evdata->info); | ||
53 | return 0; | 50 | return 0; |
54 | } | 51 | } |
55 | 52 | ||
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 0bb13df0fa89..b6449470106c 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
@@ -40,8 +40,6 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
40 | if (!ld->ops) | 40 | if (!ld->ops) |
41 | return 0; | 41 | return 0; |
42 | 42 | ||
43 | if (!lock_fb_info(evdata->info)) | ||
44 | return -ENODEV; | ||
45 | mutex_lock(&ld->ops_lock); | 43 | mutex_lock(&ld->ops_lock); |
46 | if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { | 44 | if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { |
47 | if (event == FB_EVENT_BLANK) { | 45 | if (event == FB_EVENT_BLANK) { |
@@ -53,7 +51,6 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
53 | } | 51 | } |
54 | } | 52 | } |
55 | mutex_unlock(&ld->ops_lock); | 53 | mutex_unlock(&ld->ops_lock); |
56 | unlock_fb_info(evdata->info); | ||
57 | return 0; | 54 | return 0; |
58 | } | 55 | } |
59 | 56 | ||