diff options
| author | Linus Torvalds <[email protected]> | 2019-05-08 03:34:21 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2019-05-08 03:34:21 +0000 |
| commit | d897166d8598e362a31d79dfd9a1e2eedb9ac85c (patch) | |
| tree | eb799f89e18e8ae41605e9a7388c6ca9026b0e10 /drivers/gpu/drm/drm_syncobj.c | |
| parent | Merge branch 'work.mount-syscalls' of git://git.kernel.org/pub/scm/linux/kern... (diff) | |
| parent | media: switch to fdget() (diff) | |
| download | kernel-d897166d8598e362a31d79dfd9a1e2eedb9ac85c.tar.gz kernel-d897166d8598e362a31d79dfd9a1e2eedb9ac85c.zip | |
Merge branch 'work.file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs 'struct file' related updates from Al Viro:
"A bit more of 'this fget() would be better off as fdget()'
whack-a-mole + a couple of ->f_count-related cleanups"
* 'work.file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
media: switch to fdget()
drm_syncobj: switch to fdget()
amdgpu: switch to fdget()
don't open-code file_count()
fs: drop unused fput_atomic definition
Diffstat (limited to 'drivers/gpu/drm/drm_syncobj.c')
| -rw-r--r-- | drivers/gpu/drm/drm_syncobj.c | 13 |
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; } |
