summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Zhang <Jack.Zhang1@amd.com>2020-04-01 20:06:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 10:30:20 +0200
commit044a884072b4313554d910b792f46c3e1f0099a5 (patch)
tree75938d73e8bab60dc1ace256074722cc75e0b189
parent67e5b7090905050a8c5efbe14889695a1c6b77f6 (diff)
downloadlinux-stable-044a884072b4313554d910b792f46c3e1f0099a5.tar.gz
linux-stable-044a884072b4313554d910b792f46c3e1f0099a5.tar.bz2
linux-stable-044a884072b4313554d910b792f46c3e1f0099a5.zip
drm/amdkfd: kfree the wrong pointer
[ Upstream commit 3148a6a0ef3cf93570f30a477292768f7eb5d3c3 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 938d0053a820..28022d1cb0f0 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -921,9 +921,9 @@ kfd_gtt_out:
return 0;
kfd_gtt_no_free_chunk:
- pr_debug("Allocation failed with mem_obj = %p\n", mem_obj);
+ pr_debug("Allocation failed with mem_obj = %p\n", *mem_obj);
mutex_unlock(&kfd->gtt_sa_lock);
- kfree(mem_obj);
+ kfree(*mem_obj);
return -ENOMEM;
}