mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
fdget(), trivial conversions
fdget() is the first thing done in scope, all matching fdput() are immediately followed by leaving the scope. Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -712,16 +712,14 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
|
||||
int fd, u32 *handle)
|
||||
{
|
||||
struct drm_syncobj *syncobj;
|
||||
struct fd f = fdget(fd);
|
||||
CLASS(fd, f)(fd);
|
||||
int ret;
|
||||
|
||||
if (!fd_file(f))
|
||||
if (fd_empty(f))
|
||||
return -EINVAL;
|
||||
|
||||
if (fd_file(f)->f_op != &drm_syncobj_file_fops) {
|
||||
fdput(f);
|
||||
if (fd_file(f)->f_op != &drm_syncobj_file_fops)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* take a reference to put in the idr */
|
||||
syncobj = fd_file(f)->private_data;
|
||||
@@ -739,7 +737,6 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
|
||||
} else
|
||||
drm_syncobj_put(syncobj);
|
||||
|
||||
fdput(f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user