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: 95a2f91738 ("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>
This commit is contained in:
Chen Tao 2020-06-17 18:51:30 +08:00 коммит произвёл Alex Deucher
Родитель 3e4aeff36e
Коммит 888e32d711
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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);