]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/nouveau/nvif: Fix potential memory leak in nvif_vmm_ctor().
authorFanhua Li <lifanhua5@huawei.com>
Mon, 28 Jul 2025 11:50:27 +0000 (19:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:47 +0000 (16:28 +0200)
commit72553fe19317fe93cb8591c83095c446bc7fe292
treea2716057be99fa3f4988f305b4ba9f6bc6b625b1
parentad994eda5d9545f7d9bce11eb9e5556dfba464a9
drm/nouveau/nvif: Fix potential memory leak in nvif_vmm_ctor().

[ Upstream commit bb8aeaa3191b617c6faf8ae937252e059673b7ea ]

When the nvif_vmm_type is invalid, we will return error directly
without freeing the args in nvif_vmm_ctor(), which leading a memory
leak. Fix it by setting the ret -EINVAL and goto done.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/all/202312040659.4pJpMafN-lkp@intel.com/
Fixes: 6b252cf42281 ("drm/nouveau: nvkm/vmm: implement raw ops to manage uvmm")
Signed-off-by: Fanhua Li <lifanhua5@huawei.com>
Link: https://lore.kernel.org/r/20250728115027.50878-1-lifanhua5@huawei.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/nouveau/nvif/vmm.c