drm/radeon/uvd: Fix forgotten unmap buffer objects
authorzhanglianjie <zhanglianjie@uniontech.com>
Tue, 8 Feb 2022 08:03:20 +0000 (16:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Feb 2022 21:57:51 +0000 (16:57 -0500)
After the buffer object is successfully mapped,
call radeon_bo_kunmap before the function returns.

Signed-off-by: zhanglianjie <zhanglianjie@uniontech.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_uvd.c

index 377f9cd..0558d92 100644 (file)
@@ -497,6 +497,7 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
        handle = msg[2];
 
        if (handle == 0) {
+               radeon_bo_kunmap(bo);
                DRM_ERROR("Invalid UVD handle!\n");
                return -EINVAL;
        }
@@ -559,12 +560,10 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
                return 0;
 
        default:
-
                DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-               return -EINVAL;
        }
 
-       BUG();
+       radeon_bo_kunmap(bo);
        return -EINVAL;
 }