video: cfb_console: fix hang if splashimage file is missing
authorAnatolij Gustschin <agust@denx.de>
Wed, 30 Nov 2016 13:30:59 +0000 (14:30 +0100)
committerAnatolij Gustschin <agust@denx.de>
Fri, 13 Jan 2017 19:20:35 +0000 (20:20 +0100)
If the splash file doesn't exist, the booting stops bricking
the boards. Check return value of prepare function and stop
decoding the logo data if splash prepare stage failed.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
drivers/video/cfb_console.c

index c0b1b8dc17e2bd15785e97a209f42ea9843be0cf..a4cbc4456491a1afc7cbe1d69d9e226fc62ca75e 100644 (file)
@@ -1861,14 +1861,16 @@ static void *video_logo(void)
        __maybe_unused int y_off = 0;
        __maybe_unused ulong addr;
        __maybe_unused char *s;
-       __maybe_unused int len, space;
+       __maybe_unused int len, ret, space;
 
        splash_get_pos(&video_logo_xpos, &video_logo_ypos);
 
 #ifdef CONFIG_SPLASH_SCREEN
        s = getenv("splashimage");
        if (s != NULL) {
-               splash_screen_prepare();
+               ret = splash_screen_prepare();
+               if (ret < 0)
+                       return video_fb_address;
                addr = simple_strtoul(s, NULL, 16);
 
                if (video_display_bitmap(addr,