From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zx8vp-0005HW-0u for barebox@lists.infradead.org; Fri, 13 Nov 2015 07:38:01 +0000 From: Sascha Hauer Date: Fri, 13 Nov 2015 08:37:37 +0100 Message-Id: <1447400257-1198-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] graphics_utils: check for valid framebuffer before creating a screen To: Barebox List Otherwise we crash later when we try to print on that screen. Signed-off-by: Sascha Hauer --- lib/gui/graphic_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 4c1885d..2fe9fa3 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -249,6 +249,10 @@ struct screen *fb_create_screen(struct fb_info *info) { struct screen *sc; + if (!info->xres || !info->yres || !info->line_length || + !info->screen_base) + return ERR_PTR(-EINVAL); + sc = xzalloc(sizeof(*sc)); sc->s.x = 0; -- 2.6.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox