drm/amdgpu: avoid using null object of framebuffer
authorJulia Zhang <julia.zhang@amd.com>
Mon, 3 Jun 2024 11:31:09 +0000 (19:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Jun 2024 18:22:08 +0000 (14:22 -0400)
commitbcfa48ff785bd121316592b131ff6531e3e696bb
tree268cc0d0d4f1e007b4bf3f7731f0f096c7623ee1
parent2ec6c7f802332d1eff16f03e7c757f1543ee1183
drm/amdgpu: avoid using null object of framebuffer

Instead of using state->fb->obj[0] directly, get object from framebuffer
by calling drm_gem_fb_get_obj() and return error code when object is
null to avoid using null object of framebuffer.

Reported-by: Fusheng Huang <fusheng.huang@ecarxgroup.com>
Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c