]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node
authorZhipeng Lu <alexious@zju.edu.cn>
Mon, 4 Dec 2023 09:14:16 +0000 (17:14 +0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:42 +0000 (18:19 -0400)
commit83e0f220d1e992fa074157fcf14945bf170ffbc5
tree5956bd2d0cfa03a144a88550e190044abf5fe888
parent9556c167673057d48ce4a0da675026fe046654c1
drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node

[ Upstream commit 89709105a6091948ffb6ec2427954cbfe45358ce ]

When ida_alloc_max fails, resources allocated before should be freed,
including *res allocated by kmalloc and ttm_resource_init.

Fixes: d3bcb4b02fe9 ("drm/vmwgfx: switch the TTM backends to self alloc")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231204091416.3308430-1-alexious@zju.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c