Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        struct amdgpu_ring *ring;
-       int i;
+       int i, j;
 
        for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
                if (adev->vcn.harvest_config & (1 << i))
 
                ring->sched.ready = false;
 
-               for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
-                       ring = &adev->vcn.inst[i].ring_enc[i];
+               for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
+                       ring = &adev->vcn.inst[i].ring_enc[j];
                        ring->sched.ready = false;
                }