Commit 733965a9 authored by Flora Cui's avatar Flora Cui Committed by Alex Deucher

drm/amdkfd: init drm_client with funcs hook

otherwise drm_client_dev_unregister() would try to
kfree(&adev->kfd.client).

Fixes: 18192001 ("drm/amdkfd: Export DMABufs from KFD using GEM handles")
Signed-off-by: default avatarFlora Cui <flora.cui@amd.com>
Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ab762f93
...@@ -138,6 +138,9 @@ static void amdgpu_amdkfd_reset_work(struct work_struct *work) ...@@ -138,6 +138,9 @@ static void amdgpu_amdkfd_reset_work(struct work_struct *work)
amdgpu_device_gpu_recover(adev, NULL, &reset_context); amdgpu_device_gpu_recover(adev, NULL, &reset_context);
} }
static const struct drm_client_funcs kfd_client_funcs = {
.unregister = drm_client_release,
};
void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
{ {
int i; int i;
...@@ -161,7 +164,7 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) ...@@ -161,7 +164,7 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
.enable_mes = adev->enable_mes, .enable_mes = adev->enable_mes,
}; };
ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd", NULL); ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd", &kfd_client_funcs);
if (ret) { if (ret) {
dev_err(adev->dev, "Failed to init DRM client: %d\n", ret); dev_err(adev->dev, "Failed to init DRM client: %d\n", ret);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment