mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-03-09 07:09:52 +00:00
550.40.07
This commit is contained in:
@@ -109,21 +109,26 @@ void __nvoc_init_KernelVgpuMgr(KernelVgpuMgr *pThis) {
|
||||
__nvoc_init_funcTable_KernelVgpuMgr(pThis);
|
||||
}
|
||||
|
||||
NV_STATUS __nvoc_objCreate_KernelVgpuMgr(KernelVgpuMgr **ppThis, Dynamic *pParent, NvU32 createFlags) {
|
||||
NV_STATUS __nvoc_objCreate_KernelVgpuMgr(KernelVgpuMgr **ppThis, Dynamic *pParent, NvU32 createFlags)
|
||||
{
|
||||
NV_STATUS status;
|
||||
Object *pParentObj;
|
||||
Object *pParentObj = NULL;
|
||||
KernelVgpuMgr *pThis;
|
||||
|
||||
// Assign `pThis`, allocating memory unless suppressed by flag.
|
||||
status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(KernelVgpuMgr), (void**)&pThis, (void**)ppThis);
|
||||
if (status != NV_OK)
|
||||
return status;
|
||||
|
||||
// Zero is the initial value for everything.
|
||||
portMemSet(pThis, 0, sizeof(KernelVgpuMgr));
|
||||
|
||||
// Initialize runtime type information.
|
||||
__nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_KernelVgpuMgr);
|
||||
|
||||
pThis->__nvoc_base_Object.createFlags = createFlags;
|
||||
|
||||
// Link the child into the parent if there is one unless flagged not to do so.
|
||||
if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
|
||||
{
|
||||
pParentObj = dynamicCast(pParent, Object);
|
||||
@@ -138,16 +143,25 @@ NV_STATUS __nvoc_objCreate_KernelVgpuMgr(KernelVgpuMgr **ppThis, Dynamic *pParen
|
||||
status = __nvoc_ctor_KernelVgpuMgr(pThis);
|
||||
if (status != NV_OK) goto __nvoc_objCreate_KernelVgpuMgr_cleanup;
|
||||
|
||||
// Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
|
||||
*ppThis = pThis;
|
||||
|
||||
return NV_OK;
|
||||
|
||||
__nvoc_objCreate_KernelVgpuMgr_cleanup:
|
||||
// do not call destructors here since the constructor already called them
|
||||
|
||||
// Unlink the child from the parent if it was linked above.
|
||||
if (pParentObj != NULL)
|
||||
objRemoveChild(pParentObj, &pThis->__nvoc_base_Object);
|
||||
|
||||
// Do not call destructors here since the constructor already called them.
|
||||
if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
|
||||
portMemSet(pThis, 0, sizeof(KernelVgpuMgr));
|
||||
else
|
||||
{
|
||||
portMemFree(pThis);
|
||||
*ppThis = NULL;
|
||||
}
|
||||
|
||||
// coverity[leaked_storage:FALSE]
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user