diff options
author | Christian König <christian.koenig@amd.com> | 2015-08-18 16:23:16 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-20 21:05:34 (GMT) |
commit | b203dd95949ec8d5e30d53446408eb9a4d1bdc62 (patch) | |
tree | 487953f129b674d1f2ea7b7fa9704de52f946ee7 /drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | |
parent | bf7ebaeed4dca7c0a7f9d9a44efbd9f74cf22c5d (diff) | |
download | linux-b203dd95949ec8d5e30d53446408eb9a4d1bdc62.tar.xz |
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_v3_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index 029f345..6f1df03 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c @@ -810,6 +810,7 @@ static int sdma_v3_0_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); |