drm/radeon: stop sending invalid UVD destroy msg
authorChristian König <christian.koenig@amd.com>
Mon, 5 Aug 2013 12:10:56 +0000 (14:10 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 Aug 2013 21:37:15 +0000 (17:37 -0400)
We also need to check the handle.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_uvd.c

index ca0d7358ed33548496c981e68e54f53586434e11..4fec195e0dd4eb8b06dcdfbccaa36036902aadcc 100644 (file)
@@ -235,8 +235,8 @@ void radeon_uvd_free_handles(struct radeon_device *rdev, struct drm_file *filp)
 {
        int i, r;
        for (i = 0; i < RADEON_MAX_UVD_HANDLES; ++i) {
-               if (rdev->uvd.filp[i] == filp) {
-                       uint32_t handle = atomic_read(&rdev->uvd.handles[i]);
+               uint32_t handle = atomic_read(&rdev->uvd.handles[i]);
+               if (handle != 0 && rdev->uvd.filp[i] == filp) {
                        struct radeon_fence *fence;
 
                        r = radeon_uvd_get_destroy_msg(rdev,