drm/amd/amdgpu: fix potential memleak
authorBernard Zhao <bernard@vivo.com>
Mon, 15 Nov 2021 02:58:50 +0000 (18:58 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:39 +0000 (09:04 +0100)
commit75752ada77e0726327adf68018b9f50ae091baeb
tree4b1bcfa34d1a7d189cc16c184dc6343c82b4b901
parent06c6f8f86ec243b89e52f0c3dc7062bcb9de74df
drm/amd/amdgpu: fix potential memleak

[ Upstream commit 27dfaedc0d321b4ea4e10c53e4679d6911ab17aa ]

In function amdgpu_get_xgmi_hive, when kobject_init_and_add failed
There is a potential memleak if not call kobject_put.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Bernard Zhao <bernard@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c