]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/tegra: put drm_gem_object ref on error in tegra_fb_create
authorFedor Pchelkin <pchelkin@ispras.ru>
Fri, 15 Dec 2023 09:33:55 +0000 (12:33 +0300)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:50 +0000 (18:19 -0400)
commitf33bf922d49d472b8d6900df89535c6f0ba86271
tree3619f0d42dc5c617dfaeffaaf781ce33d85c798a
parent6ff01b314149d1cf59caebc29384f0beed21cba4
drm/tegra: put drm_gem_object ref on error in tegra_fb_create

[ Upstream commit 32e5a120a5105bce01561978ee55aee8e40ac0dc ]

Inside tegra_fb_create(), drm_gem_object_lookup() increments ref count of
the found object. But if the following size check fails then the last
found object's ref count should be put there as the unreferencing loop
can't detect this situation.

Found by Linux Verification Center (linuxtesting.org).

Fixes: de2ba664c30f ("gpu: host1x: drm: Add memory manager and fb")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231215093356.12067-1-pchelkin@ispras.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/tegra/fb.c