aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-08-18 18:23:16 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-08-20 17:05:34 -0400
commitb203dd95949ec8d5e30d53446408eb9a4d1bdc62 (patch)
tree487953f129b674d1f2ea7b7fa9704de52f946ee7 /drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
parentdrm/amdgpu: free the job immediately after dispatching it (diff)
downloadlinux-dev-b203dd95949ec8d5e30d53446408eb9a4d1bdc62.tar.xz
linux-dev-b203dd95949ec8d5e30d53446408eb9a4d1bdc62.zip
drm/amdgpu: fix zeroing all IB fields manually v2
The problem now is that we don't necessarily call amdgpu_ib_get() in some error paths and so work with uninitialized data. Better require that the memory is already zeroed. v2: better commit message Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> (v1) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index 9de8104eddeb..2b0e89e05b1d 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -689,6 +689,7 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring)
gpu_addr = adev->wb.gpu_addr + (index * 4);
tmp = 0xCAFEDEAD;
adev->wb.wb[index] = cpu_to_le32(tmp);
+ memset(&ib, 0, sizeof(ib));
r = amdgpu_ib_get(ring, NULL, 256, &ib);
if (r) {
DRM_ERROR("amdgpu: failed to get ib (%d).\n", r);