summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2010-05-10 09:25:55 +0200
committerBen Skeggs <bskeggs@redhat.com>2010-05-10 15:19:41 +1000
commit4b8f1a082069a17555d4142003213cf83d4e5464 (patch)
treee844cd4dc8027bf4cedba40d6f7b08ae55b6e9e1
parentac8f8d14a82ae8ba5b41fa88903edcad67f339c2 (diff)
Handle startup without monitor attached more gracefully
Refuse to configure a screen which has no valid modes. Otherwise X server would crash attempting to dereference to modes list later on. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--src/nv_driver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 795859f..f60b6d9 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -794,6 +794,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->depth);
}
+ /* No usable mode */
+ if (!pScrn->modes)
+ return FALSE;
+
/* Set the current mode to the first in the list */
pScrn->currentMode = pScrn->modes;