[PATCH 05/18] KDrive: Bail out if screen initialization failed

Geert Uytterhoeven geert at linux-m68k.org
Wed Mar 27 06:20:38 PDT 2013


Else we may get a segmentation fault later.

Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
---
 hw/kdrive/src/kdrive.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 716f18e..84d39bb 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -943,7 +943,8 @@ KdInitScreen(ScreenInfo * pScreenInfo,
 {
     KdCardInfo *card = screen->card;
 
-    (*card->cfuncs->scrinit) (screen);
+    if (!(*card->cfuncs->scrinit) (screen))
+        FatalError("Screen initialization failed!\n");
 
     if (!card->cfuncs->initAccel)
         screen->dumb = TRUE;
-- 
1.7.0.4



More information about the xorg-devel mailing list