kms: fix cursor buffer[0] leaked when cursor buffer[1] allocation fails

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
This commit is contained in:
Joseph Crowell
2026-01-23 19:26:55 +10:00
parent 49def5180a
commit ba02a2efdd

View File

@@ -2355,6 +2355,8 @@ static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen)
if (!(drmmode_crtc->cursor_buffer[i])) {
ErrorF("Failed to allocate cursor buffer memory\n");
if (i > 0)
amdgpu_bo_unref(&drmmode_crtc->cursor_buffer[0]);
return FALSE;
}