modesetting: get pEnt after error checks

This saves us having to make sure we clean it up.

Pointed out by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2018-09-12 10:56:40 +10:00
parent f0a5c0d1fd
commit b6c29a881e
1 changed files with 2 additions and 2 deletions

View File

@ -900,8 +900,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (pScrn->numEntities != 1)
return FALSE;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
if (flags & PROBE_DETECT) {
return FALSE;
}
@ -910,6 +908,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
if (!GetRec(pScrn))
return FALSE;
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
ms = modesettingPTR(pScrn);
ms->SaveGeneration = -1;
ms->pEnt = pEnt;