@@ -1741,8 +1741,7 @@ void fb_set_suspend(struct fb_info *info, int state)
{
struct fb_event event;
- if (!lock_fb_info(info))
- return;
+ WARN_ON(info->state == FBINFO_STATE_EXITING);
event.info = info;
if (state) {
fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
@@ -1751,7 +1750,6 @@ void fb_set_suspend(struct fb_info *info, int state)
info->state = FBINFO_STATE_RUNNING;
fb_notifier_call_chain(FB_EVENT_RESUME, &event);
}
- unlock_fb_info(info);
}
/**
@@ -401,9 +401,12 @@ static ssize_t store_fbstate(struct device *device,
if (state && state > 1)
return -EINVAL;
+ if (!lock_fb_info(fb_info))
+ return -ENODEV;
acquire_console_sem();
fb_set_suspend(fb_info, (int)state);
release_console_sem();
+ unlock_fb_info(fb_info);
return count;
}