drm/amdgpu: fix bug in fence driver fini
authorMonk Liu <Monk.Liu@amd.com>
Wed, 18 May 2016 08:15:47 +0000 (16:15 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 25 May 2016 13:42:53 +0000 (09:42 -0400)
Using wrong counter for walking fences.  Fixes
a crash when unloading the driver.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

index 7eb2fca871e8e0b563397c01a130cff8326bfe47..d1558768cfb73d57e30618b971a5edb5d1f1d54f 100644 (file)
@@ -443,7 +443,7 @@ void amdgpu_fence_driver_fini(struct amdgpu_device *adev)
                amd_sched_fini(&ring->sched);
                del_timer_sync(&ring->fence_drv.fallback_timer);
                for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j)
-                       fence_put(ring->fence_drv.fences[i]);
+                       fence_put(ring->fence_drv.fences[j]);
                kfree(ring->fence_drv.fences);
                ring->fence_drv.initialized = false;
        }