]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Fix error pointer dereference in i915_gem_do_execbuffer()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 2 Dec 2021 04:48:31 +0000 (20:48 -0800)
committerJohn Harrison <John.C.Harrison@Intel.com>
Fri, 3 Dec 2021 19:47:29 +0000 (11:47 -0800)
Originally "out_fence" was set using out_fence = sync_file_create() but
which returns NULL, but now it is set with out_fence = eb_requests_create()
which returns error pointers.  The error path needs to be modified to
avoid an Oops in the "goto err_request;" path.

Fixes: 66c1e19d2fff ("drm/i915: Multi-BB execbuf")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211202044831.29583-1-matthew.brost@intel.com
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

index a0b80f33249a36be3c4b8f2fc5fe5c81d562f481..60ee60f7bb0922d3e3fc874d891458bdeaff0500 100644 (file)
@@ -3366,6 +3366,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
        out_fence = eb_requests_create(&eb, in_fence, out_fence_fd);
        if (IS_ERR(out_fence)) {
                err = PTR_ERR(out_fence);
+               out_fence = NULL;
                if (eb.requests[0])
                        goto err_request;
                else