Commit d699c1bb authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbdev: Check return value of fb_add_videomode

The function fb_add_videomode can fail, check return value. 
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1d0c3774
......@@ -716,6 +716,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
struct fb_videomode mode;
info->var = *var;
int err = 0;
if (info->fbops->fb_set_par)
info->fbops->fb_set_par(info);
......@@ -728,15 +729,16 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
if (info->modelist.prev && info->modelist.next &&
!list_empty(&info->modelist))
fb_add_videomode(&mode, &info->modelist);
err = fb_add_videomode(&mode, &info->modelist);
if (info->flags & FBINFO_MISC_USEREVENT) {
if (!err && info->flags & FBINFO_MISC_USEREVENT) {
struct fb_event event;
info->flags &= ~FBINFO_MISC_USEREVENT;
event.info = info;
notifier_call_chain(&fb_notifier_list,
FB_EVENT_MODE_CHANGE, &event);
FB_EVENT_MODE_CHANGE,
&event);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment