]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
Merge tag 'ext4_for_linus-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_cs.c
index 49dd9aa8da70883871c9859717f590df32fc34fa..efdb1c48f431530d01fd25eb581033472a5b5239 100644 (file)
@@ -127,7 +127,6 @@ static int amdgpu_cs_p1_user_fence(struct amdgpu_cs_parser *p,
 {
        struct drm_gem_object *gobj;
        unsigned long size;
-       int r;
 
        gobj = drm_gem_object_lookup(p->filp, data->handle);
        if (gobj == NULL)
@@ -137,23 +136,14 @@ static int amdgpu_cs_p1_user_fence(struct amdgpu_cs_parser *p,
        drm_gem_object_put(gobj);
 
        size = amdgpu_bo_size(p->uf_bo);
-       if (size != PAGE_SIZE || (data->offset + 8) > size) {
-               r = -EINVAL;
-               goto error_unref;
-       }
+       if (size != PAGE_SIZE || data->offset > (size - 8))
+               return -EINVAL;
 
-       if (amdgpu_ttm_tt_get_usermm(p->uf_bo->tbo.ttm)) {
-               r = -EINVAL;
-               goto error_unref;
-       }
+       if (amdgpu_ttm_tt_get_usermm(p->uf_bo->tbo.ttm))
+               return -EINVAL;
 
        *offset = data->offset;
-
        return 0;
-
-error_unref:
-       amdgpu_bo_unref(&p->uf_bo);
-       return r;
 }
 
 static int amdgpu_cs_p1_bo_handles(struct amdgpu_cs_parser *p,
This page took 0.025232 seconds and 4 git commands to generate.