Skip to content

Commit

Permalink
msm: kgsl: fix sync file error handling
Browse files Browse the repository at this point in the history
We need to call put_unused_fd() on failure, but only if
a file hasn't been stored into the fd yet. This function
wasn't called from kgsl_ioctl_syncsource_create_fence()
and was called incorrectly from kgsl_add_fence_event().
Reorder our sync_fence_install() calls to happen after
all possible failures so that error cleanup will be
correct.

Change-Id: I0e7bb459f2acc010446ac5e5b3b72c8b16cce079
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Kevin F. Haggerty <kevin.f.haggerty@gmail.com>
haggertk: Backport to 3.4
  • Loading branch information
jgebben authored and mdmower committed Jan 23, 2017
1 parent 1546f41 commit 63e27da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/msm/kgsl_sync.c 100755 → 100644
Expand Up @@ -159,12 +159,12 @@ int kgsl_add_fence_event(struct kgsl_device *device,
ret = -EINVAL;
goto fail_fd;
}
sync_fence_install(fence, priv.fence_fd);

if (copy_to_user(data, &priv, sizeof(priv))) {
ret = -EFAULT;
goto fail_copy_fd;
}
sync_fence_install(fence, priv.fence_fd);

/*
* Hold the context ref-count for the event - it will get released in
Expand Down

0 comments on commit 63e27da

Please sign in to comment.