File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments