mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-05-11 00:10:20 +00:00
530.30.02
This commit is contained in:
@@ -109,13 +109,16 @@ NV_STATUS __nvoc_objCreate_OBJOS(OBJOS **ppThis, Dynamic *pParent, NvU32 createF
|
||||
Object *pParentObj;
|
||||
OBJOS *pThis;
|
||||
|
||||
pThis = portMemAllocNonPaged(sizeof(OBJOS));
|
||||
if (pThis == NULL) return NV_ERR_NO_MEMORY;
|
||||
status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(OBJOS), (void**)&pThis, (void**)ppThis);
|
||||
if (status != NV_OK)
|
||||
return status;
|
||||
|
||||
portMemSet(pThis, 0, sizeof(OBJOS));
|
||||
|
||||
__nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_OBJOS);
|
||||
|
||||
pThis->__nvoc_base_Object.createFlags = createFlags;
|
||||
|
||||
if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
|
||||
{
|
||||
pParentObj = dynamicCast(pParent, Object);
|
||||
@@ -131,11 +134,17 @@ NV_STATUS __nvoc_objCreate_OBJOS(OBJOS **ppThis, Dynamic *pParent, NvU32 createF
|
||||
if (status != NV_OK) goto __nvoc_objCreate_OBJOS_cleanup;
|
||||
|
||||
*ppThis = pThis;
|
||||
|
||||
return NV_OK;
|
||||
|
||||
__nvoc_objCreate_OBJOS_cleanup:
|
||||
// do not call destructors here since the constructor already called them
|
||||
portMemFree(pThis);
|
||||
if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
|
||||
portMemSet(pThis, 0, sizeof(OBJOS));
|
||||
else
|
||||
portMemFree(pThis);
|
||||
|
||||
// coverity[leaked_storage:FALSE]
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user