555.52.04

This commit is contained in:
Bernhard Stoeckner
2024-06-05 09:39:46 +02:00
parent 5a1c474040
commit 78d807e001
36 changed files with 1140 additions and 487 deletions

View File

@@ -3894,7 +3894,7 @@ static NvBool JoinSwapGroup(
struct NvKmsJoinSwapGroupParams *pParams = pParamsVoid;
const struct NvKmsJoinSwapGroupRequestOneMember *pMember =
pParams->request.member;
NvU32 i;
NvU32 i, j;
NvBool anySwapGroupsPending = FALSE;
NVHsJoinSwapGroupWorkArea *pJoinSwapGroupWorkArea;
@@ -4013,6 +4013,28 @@ static NvBool JoinSwapGroup(
}
}
/*
* We checked above that pDeferredRequestFifo is not currently a member
* of a SwapGroup, and that pEventOpenFd is currently valid to be used
* for a unicast event. However, if either of those were also
* specified for an earlier member for this request, then that won't
* hold: by the time *this* member is processed, the
* pDeferredRequestFifo would already be a member of a swapgroup, or
* the pEventOpenFd would already be in use.
*
* Validate that that doesn't happen.
*/
for (j = 0; j < i; j++) {
if (pJoinSwapGroupWorkArea[j].pDeferredRequestFifo ==
pDeferredRequestFifo) {
goto fail;
}
if (pJoinSwapGroupWorkArea[j].pEventOpenFd ==
pEventOpenFd) {
goto fail;
}
}
pJoinSwapGroupWorkArea[i].pDevEvo = pOpenDev->pDevEvo;
pJoinSwapGroupWorkArea[i].pSwapGroup = pSwapGroup;
pJoinSwapGroupWorkArea[i].pDeferredRequestFifo = pDeferredRequestFifo;