drm/amd/amdgpu: fix potential memleak
authorBernard Zhao <bernard@vivo.com>
Mon, 15 Nov 2021 02:58:50 +0000 (18:58 -0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Nov 2021 19:45:03 +0000 (14:45 -0500)
commit7b833d680481f463276aedf500696ea25698deaa
treebbe0a595e2ac4eb57fa8d0e34507f3f1d2d2dd46
parent8b11e14bd5793cd0e5cb65055fe51588a779f05b
drm/amd/amdgpu: fix potential memleak

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c