[U-Boot] [PATCH 18/20] video: Check for valid FB pointer before clearing

Simon Glass sjg at chromium.org
Sat Nov 3 22:41:40 CET 2012


From: Duncan Laurie <dlaurie at chromium.org>

This command will start erasing at memory address zero
if there is not a valid framebuffer address that was found
during video_init().

This is a common case with Chrome OS devices in normal mode
when we do not execute the video option rom in coreboot.

Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
 drivers/video/cfb_console.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index c8d3e42..2b1f604 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1976,6 +1976,7 @@ int video_get_screen_columns(void)
 
 void video_clear(void)
 {
-	memsetl(video_fb_address,
-		(VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), 0);
+	if (video_fb_address)
+		memsetl(video_fb_address,
+			(VIDEO_VISIBLE_ROWS * VIDEO_LINE_LEN) / sizeof(int), 0);
 }
-- 
1.7.7.3



More information about the U-Boot mailing list