[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220120101746.24847-1-linmq006@gmail.com>
Date: Thu, 20 Jan 2022 10:17:43 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Hawking Zhang <Hawking.Zhang@....com>,
Felix Kuehling <Felix.Kuehling@....com>,
John Clements <john.clements@....com>,
Jonathan Kim <jonathan.kim@....com>,
Bernard Zhao <bernard@...o.com>,
Miaoqian Lin <linmq006@...il.com>,
Kevin Wang <kevin1.wang@....com>,
shaoyunl <shaoyun.liu@....com>,
Tian Tao <tiantao6@...ilicon.com>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/amdgpu: Fix double free in amdgpu_get_xgmi_hive
Callback function amdgpu_xgmi_hive_release() in kobject_put()
calls kfree(hive), So we don't need call kfree(hive) again.
Fixes: 7b833d680481 ("drm/amd/amdgpu: fix potential memleak")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index e8b8f28c2f72..35d4b966ef2c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -393,7 +393,6 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
if (ret) {
dev_err(adev->dev, "XGMI: failed initializing kobject for xgmi hive\n");
kobject_put(&hive->kobj);
- kfree(hive);
hive = NULL;
goto pro_end;
}
--
2.17.1
Powered by blists - more mailing lists