summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-02-13 19:11:00 +0100
committerMichel Dänzer <michel@daenzer.net>2018-02-14 17:07:51 +0100
commit103b7285845b786929fb509083c57e074c48f9be (patch)
tree169c26e139c08e6646f11947df07701f8adf96c1
parenta23d1ff700d486138c624c2023d8d251c73709af (diff)
Don't call AMDGPUFreeRec from AMDGPUPreInit_KMS
If the latter fails, Xorg will call AMDGPUFreeScreen_KMS, which calls the former. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_kms.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 43c18d4..f5874d3 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1352,7 +1352,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
&& info->pEnt->location.type != BUS_PLATFORM
#endif
)
- goto fail;
+ return FALSE;
pPriv = xf86GetEntityPrivate(pScrn->entityList[0],
getAMDGPUEntityIndex());
@@ -1375,23 +1375,23 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
pScrn->monitor = pScrn->confScreen->monitor;
if (!AMDGPUPreInitVisual(pScrn))
- goto fail;
+ return FALSE;
xf86CollectOptions(pScrn, NULL);
if (!(info->Options = malloc(sizeof(AMDGPUOptions_KMS))))
- goto fail;
+ return FALSE;
memcpy(info->Options, AMDGPUOptions_KMS, sizeof(AMDGPUOptions_KMS));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options);
if (!AMDGPUPreInitWeight(pScrn))
- goto fail;
+ return FALSE;
memset(&gpu_info, 0, sizeof(gpu_info));
amdgpu_query_gpu_info(pAMDGPUEnt->pDev, &gpu_info);
if (!AMDGPUPreInitChipType_KMS(pScrn, &gpu_info))
- goto fail;
+ return FALSE;
info->dri2.available = FALSE;
info->dri2.enabled = FALSE;
@@ -1399,7 +1399,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
if (info->dri2.pKernelDRMVersion == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"AMDGPUDRIGetVersion failed to get the DRM version\n");
- goto fail;
+ return FALSE;
}
/* Get ScreenInit function */
@@ -1407,7 +1407,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
return FALSE;
if (!AMDGPUPreInitAccel_KMS(pScrn))
- goto fail;
+ return FALSE;
amdgpu_drm_queue_init();
@@ -1466,7 +1466,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
FALSE) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Kernel modesetting setup failed\n");
- goto fail;
+ return FALSE;
}
AMDGPUSetupCapabilities(pScrn);
@@ -1518,14 +1518,10 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
#endif
) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n");
- goto fail;
+ return FALSE;
}
return TRUE;
-fail:
- AMDGPUFreeRec(pScrn);
- return FALSE;
-
}
static Bool AMDGPUCursorInit_KMS(ScreenPtr pScreen)