summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_syncobj.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-04-14 12:50:52 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2019-05-02 02:25:54 -0400
commitfb3862435335633edef924c2e7f2820b4c561325 (patch)
treec4d55d3b1cbbe4662bc7f075924bc79eeb946357 /drivers/gpu/drm/drm_syncobj.c
parent95ce0bce20fe67c750c0c26491a8c6819daeab94 (diff)
downloadlwn-fb3862435335633edef924c2e7f2820b4c561325.tar.gz
lwn-fb3862435335633edef924c2e7f2820b4c561325.zip
drm_syncobj: switch to fdget()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/drm_syncobj.c')
-rw-r--r--drivers/gpu/drm/drm_syncobj.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index e19525af0cce..8bdb4a3bd7bf 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -388,20 +388,19 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
int fd, u32 *handle)
{
struct drm_syncobj *syncobj;
- struct file *file;
+ struct fd f = fdget(fd);
int ret;
- file = fget(fd);
- if (!file)
+ if (!f.file)
return -EINVAL;
- if (file->f_op != &drm_syncobj_file_fops) {
- fput(file);
+ if (f.file->f_op != &drm_syncobj_file_fops) {
+ fdput(f);
return -EINVAL;
}
/* take a reference to put in the idr */
- syncobj = file->private_data;
+ syncobj = f.file->private_data;
drm_syncobj_get(syncobj);
idr_preload(GFP_KERNEL);
@@ -416,7 +415,7 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
} else
drm_syncobj_put(syncobj);
- fput(file);
+ fdput(f);
return ret;
}