From 91c878846b9f2634dae12e3fb858ac13033a1755 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 10 Mar 2015 22:40:38 -0500 Subject: [PATCH] u-boot: Improve error checking on framebuffer --- src/system/boot/platform/u-boot/video.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/system/boot/platform/u-boot/video.cpp b/src/system/boot/platform/u-boot/video.cpp index 09551ab1ff..babb638946 100644 --- a/src/system/boot/platform/u-boot/video.cpp +++ b/src/system/boot/platform/u-boot/video.cpp @@ -121,10 +121,18 @@ platform_init_video(void) #endif #endif - if (gFramebuffer != NULL) { - gFramebuffer->Probe(); - gFramebuffer->Init(); + if (gFramebuffer == NULL) { + ERROR("No framebuffer device found!\n"); + return B_ERROR; } + status_t result = gFramebuffer->Probe(); + if (result != B_OK) + return result; + + gFramebuffer->Init(); + if (result != B_OK) + return result; + return B_OK; }