summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-09-10 19:50:53 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-09-13 23:59:26 +0100
commit146090e8938ff9f7988c7821d8573d007d96a98a (patch)
treeda53bd6b7b17ba25c3d0dd4e7c1f8bfe346b0d70
parent4c1f16142ee92d6fc0cd6526d26ff92ecf31e9d9 (diff)
src: fix failure to enter VT
If EnterVT fails, we end up segfaulting the server, because we have marked the vtSema true when this isn't the case - we try to LeaveVT twice, once for the fatal error (which causes a segfault) and once more as a result of the segfault. Ensure that we reset this flag when EnterVT fails to avoid this error. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/armada_drm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/armada_drm.c b/src/armada_drm.c
index c9aabc7..5a245f5 100644
--- a/src/armada_drm.c
+++ b/src/armada_drm.c
@@ -366,6 +366,7 @@ static Bool armada_drm_ScreenInit(SCREEN_INIT_ARGS_DECL)
struct common_drm_info *drm = GET_DRM_INFO(pScrn);
struct armada_drm_info *arm = GET_ARMADA_DRM_INFO(pScrn);
struct drm_armada_bo *bo;
+ Bool ret;
if (drmSetMaster(drm->fd)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -417,7 +418,11 @@ static Bool armada_drm_ScreenInit(SCREEN_INIT_ARGS_DECL)
pScrn->vtSema = TRUE;
- return common_drm_EnterVT(VT_FUNC_ARGS(0));
+ ret = common_drm_EnterVT(VT_FUNC_ARGS(0));
+ if (!ret)
+ pScrn->vtSema = FALSE;
+
+ return ret;
}
static Bool armada_drm_pre_init(ScrnInfoPtr pScrn)