Skip to content

Commit 8c6211e

Browse files
xz-devYanVugenfirer
authored andcommitted
[viogpu] Fix resource leak when framebuffer init fails
When VioGpuObj::Init() fails in CreateFrameBufferObj(), the GPU resource and ID allocated earlier are not cleaned up, causing host-side resource leak. Add DestroyResource() and PutId() calls before returning FALSE. Signed-off-by: xiangzhe <xiangzhedev@gmail.com>
1 parent 7107f46 commit 8c6211e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

viogpu/viogpudo/viogpudo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3694,6 +3694,8 @@ BOOLEAN VioGpuAdapter::CreateFrameBufferObj(PVIDEO_MODE_INFORMATION pModeInfo, C
36943694
if (!obj->Init(size, &m_FrameSegment))
36953695
{
36963696
DbgPrint(TRACE_LEVEL_FATAL, ("<--- %s Failed to init obj size = %d\n", __FUNCTION__, size));
3697+
m_CtrlQueue.DestroyResource(resid);
3698+
m_Idr.PutId(resid);
36973699
delete obj;
36983700
return FALSE;
36993701
}

0 commit comments

Comments
 (0)