From 146090e8938ff9f7988c7821d8573d007d96a98a Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 10 Sep 2014 19:50:53 +0100 Subject: 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 --- src/armada_drm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3