Skip to content

Commit c746945

Browse files
Bernard Zhaogregkh
authored andcommitted
drm/amd/amdgpu: fix potential memleak
[ Upstream commit 27dfaed ] 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>
1 parent 74aafe9 commit c746945

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
358358
"%s", "xgmi_hive_info");
359359
if (ret) {
360360
dev_err(adev->dev, "XGMI: failed initializing kobject for xgmi hive\n");
361+
kobject_put(&hive->kobj);
361362
kfree(hive);
362363
hive = NULL;
363364
goto pro_end;

0 commit comments

Comments
 (0)