aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-11-22 09:55:21 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-11-28 17:44:14 -0500
commitfa7c7939b4bf112cd06ba166b739244077898990 (patch)
treedb5b7742c26247e7d67aab43cca8952ec25777f3 /drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
parent89ce6e0afee8eafa679093207dabd717af9d09c5 (diff)
drm/amdgpu: Use unsigned ring indices in amdgpu_queue_mgr_map
This matches the corresponding UAPI fields. Treating the ring index as signed could result in accessing random unrelated memory if the MSB was set. Fixes: effd924d2f3b ("drm/amdgpu: untie user ring ids from kernel ring ids v6") Cc: stable@vger.kernel.org Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
index 190e28cb827e..93d86619e802 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c
@@ -63,7 +63,7 @@ static int amdgpu_update_cached_map(struct amdgpu_queue_mapper *mapper,
63 63
64static int amdgpu_identity_map(struct amdgpu_device *adev, 64static int amdgpu_identity_map(struct amdgpu_device *adev,
65 struct amdgpu_queue_mapper *mapper, 65 struct amdgpu_queue_mapper *mapper,
66 int ring, 66 u32 ring,
67 struct amdgpu_ring **out_ring) 67 struct amdgpu_ring **out_ring)
68{ 68{
69 switch (mapper->hw_ip) { 69 switch (mapper->hw_ip) {
@@ -121,7 +121,7 @@ static enum amdgpu_ring_type amdgpu_hw_ip_to_ring_type(int hw_ip)
121 121
122static int amdgpu_lru_map(struct amdgpu_device *adev, 122static int amdgpu_lru_map(struct amdgpu_device *adev,
123 struct amdgpu_queue_mapper *mapper, 123 struct amdgpu_queue_mapper *mapper,
124 int user_ring, bool lru_pipe_order, 124 u32 user_ring, bool lru_pipe_order,
125 struct amdgpu_ring **out_ring) 125 struct amdgpu_ring **out_ring)
126{ 126{
127 int r, i, j; 127 int r, i, j;
@@ -208,7 +208,7 @@ int amdgpu_queue_mgr_fini(struct amdgpu_device *adev,
208 */ 208 */
209int amdgpu_queue_mgr_map(struct amdgpu_device *adev, 209int amdgpu_queue_mgr_map(struct amdgpu_device *adev,
210 struct amdgpu_queue_mgr *mgr, 210 struct amdgpu_queue_mgr *mgr,
211 int hw_ip, int instance, int ring, 211 u32 hw_ip, u32 instance, u32 ring,
212 struct amdgpu_ring **out_ring) 212 struct amdgpu_ring **out_ring)
213{ 213{
214 int r, ip_num_rings; 214 int r, ip_num_rings;