Commit 3148a6a0ef3cf93570f30a477292768f7eb5d3c3

Authored by Jack Zhang
Committed by Alex Deucher
1 parent d6e7042f4e

drm/amdkfd: kfree the wrong pointer

Originally, it kfrees the wrong pointer for mem_obj.
It would cause memory leak under stress test.

Signed-off-by: Jack Zhang <Jack.Zhang1@amd.com>
Acked-by: Nirmoy Das <nirmoy.das@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/gpu/drm/amd/amdkfd/kfd_device.c
... ... @@ -1112,9 +1112,9 @@
1112 1112 return 0;
1113 1113  
1114 1114 kfd_gtt_no_free_chunk:
1115   - pr_debug("Allocation failed with mem_obj = %p\n", mem_obj);
  1115 + pr_debug("Allocation failed with mem_obj = %p\n", *mem_obj);
1116 1116 mutex_unlock(&kfd->gtt_sa_lock);
1117   - kfree(mem_obj);
  1117 + kfree(*mem_obj);
1118 1118 return -ENOMEM;
1119 1119 }
1120 1120