]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/rockchip: cleanup fb when drm_gem_fb_afbc_init failed
authorAndy Yan <andy.yan@rock-chips.com>
Fri, 9 May 2025 03:15:59 +0000 (11:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:44 +0000 (12:08 +0200)
commitc4a298ae0d36f60f00a3f8a841723e940388a227
treee8d7a529ee167468b366b29cfe3a7285855d22fa
parent8b0285fbbd81a56f669f5c272f5762cfe08349fe
drm/rockchip: cleanup fb when drm_gem_fb_afbc_init failed

[ Upstream commit 099593a28138b48feea5be8ce700e5bc4565e31d ]

In the function drm_gem_fb_init_with_funcs, the framebuffer (fb)
and its corresponding object ID have already been registered.

So we need to cleanup the drm framebuffer if the subsequent
execution of drm_gem_fb_afbc_init fails.

Directly call drm_framebuffer_put to ensure that all fb related
resources are cleanup.

Fixes: 7707f7227f09 ("drm/rockchip: Add support for afbc")
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20250509031607.2542187-1-andyshrk@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/rockchip/rockchip_drm_fb.c