Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/nvidia/src/kernel/gpu/fifo/kernel_channel_group_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ kchangrpapiConstruct_IMPL
)
{
NvBool bTsgAllocated = NV_FALSE;
NvBool bRpcAllocated = NV_FALSE;
RsResourceRef *pResourceRef = pCallContext->pResourceRef;
NV_STATUS rmStatus;
OBJVASPACE *pVAS = NULL;
Expand Down Expand Up @@ -478,6 +479,7 @@ kchangrpapiConstruct_IMPL
"KernelChannelGroupApi alloc RPC to vGpu Host failed\n");
goto failed;
}
bRpcAllocated = NV_TRUE;

if (IS_VIRTUAL_WITH_FULL_SRIOV(pGpu) || IS_GSP_CLIENT(pGpu))
{
Expand Down Expand Up @@ -561,6 +563,21 @@ kchangrpapiConstruct_IMPL
pKernelChannelGroupApi->hKernelGraphicsContext);
}

//
// A failed constructor is never destructed, so the RPC free requested
// through bRpcFree does not happen. Free the object on GSP/host here,
// otherwise it keeps its handle and grpID there after they are
// released on this side.
//
if (bRpcAllocated)
{
NV_STATUS tmpStatus = NV_OK;

NV_RM_RPC_FREE(pGpu, pParams->hClient, pParams->hParent,
pParams->hResource, tmpStatus);
NV_ASSERT(tmpStatus == NV_OK);
}

if (pKernelChannelGroup != NULL)
{
if (bTsgAllocated)
Expand Down