summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
diff options
context:
space:
mode:
authorChen Tao <chentao107@huawei.com>2020-06-17 18:51:30 +0800
committerAlex Deucher <alexander.deucher@amd.com>2020-07-01 01:59:22 -0400
commit888e32d71115e26b57bdcbc717c68e9c5026bac3 (patch)
tree2764a5142feae52013b2fc10caf1002807a1cb86 /drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
parent3e4aeff36e9212a939290c0ca70d4931c4ad1950 (diff)
downloadlinux-stable-888e32d71115e26b57bdcbc717c68e9c5026bac3.tar.gz
linux-stable-888e32d71115e26b57bdcbc717c68e9c5026bac3.tar.bz2
linux-stable-888e32d71115e26b57bdcbc717c68e9c5026bac3.zip
drm/amdgpu/debugfs: fix memory leak when amdgpu_virt_enable_access_debugfs failed
Fix memory leak in amdgpu_debugfs_gpr_read not freeing data when amdgpu_virt_enable_access_debugfs failed. Fixes: 95a2f917387a2 ("drm/amdgpu: restrict debugfs register access under SR-IOV") Signed-off-by: Chen Tao <chentao107@huawei.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 3d0e8f8f733e..0ac9aab69497 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -941,7 +941,7 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
r = amdgpu_virt_enable_access_debugfs(adev);
if (r < 0)
- return r;
+ goto err;
/* switch to the specific se/sh/cu */
mutex_lock(&adev->grbm_idx_mutex);