Skip to content

Commit fb38624

Browse files
author
Al Viro
committed
drm_syncobj: switch to fdget()
Signed-off-by: Al Viro <[email protected]>
1 parent 95ce0bc commit fb38624

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/gpu/drm/drm_syncobj.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -388,20 +388,19 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
388388
int fd, u32 *handle)
389389
{
390390
struct drm_syncobj *syncobj;
391-
struct file *file;
391+
struct fd f = fdget(fd);
392392
int ret;
393393

394-
file = fget(fd);
395-
if (!file)
394+
if (!f.file)
396395
return -EINVAL;
397396

398-
if (file->f_op != &drm_syncobj_file_fops) {
399-
fput(file);
397+
if (f.file->f_op != &drm_syncobj_file_fops) {
398+
fdput(f);
400399
return -EINVAL;
401400
}
402401

403402
/* take a reference to put in the idr */
404-
syncobj = file->private_data;
403+
syncobj = f.file->private_data;
405404
drm_syncobj_get(syncobj);
406405

407406
idr_preload(GFP_KERNEL);
@@ -416,7 +415,7 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
416415
} else
417416
drm_syncobj_put(syncobj);
418417

419-
fput(file);
418+
fdput(f);
420419
return ret;
421420
}
422421

0 commit comments

Comments
 (0)