fbdev: Check return value of fb_add_videomode

Started by Antonino A. Daplas on Dec 21, 2004

Subsystems (2)

Maintainers (2)

DORMANTno replies

open the first message on its own page

Message details and related content
The function fb_add_videomode can fail, check return value.  

Signed-off-by: Antonino Daplas <redacted>
---

 fbmem.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c	2004-12-21 22:44:55 +08:00
+++ b/drivers/video/fbmem.c	2004-11-29 20:07:51 +08:00
@@ -716,6 +716,7 @@
 		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 @@
 
 			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);
 			}
 		}
 	}




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help