diff --git a/sys/dev/drm/amd/amdgpu/amdgpu_fb.c b/sys/dev/drm/amd/amdgpu/amdgpu_fb.c --- a/sys/dev/drm/amd/amdgpu/amdgpu_fb.c +++ b/sys/dev/drm/amd/amdgpu/amdgpu_fb.c @@ -307,7 +307,11 @@ out: if (abo) { - + /* On error paths where the framebuffer was never set up + * (fb == NULL), release the GEM object reference to avoid + * permanently leaking VRAM. */ + if (!fb) + drm_gem_object_put_unlocked(gobj); } if (fb && ret) { drm_gem_object_put_unlocked(gobj);