提交 fb386243 编写于 作者: A Al Viro

drm_syncobj: switch to fdget()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 95ce0bce
...@@ -388,20 +388,19 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private, ...@@ -388,20 +388,19 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
int fd, u32 *handle) int fd, u32 *handle)
{ {
struct drm_syncobj *syncobj; struct drm_syncobj *syncobj;
struct file *file; struct fd f = fdget(fd);
int ret; int ret;
file = fget(fd); if (!f.file)
if (!file)
return -EINVAL; return -EINVAL;
if (file->f_op != &drm_syncobj_file_fops) { if (f.file->f_op != &drm_syncobj_file_fops) {
fput(file); fdput(f);
return -EINVAL; return -EINVAL;
} }
/* take a reference to put in the idr */ /* take a reference to put in the idr */
syncobj = file->private_data; syncobj = f.file->private_data;
drm_syncobj_get(syncobj); drm_syncobj_get(syncobj);
idr_preload(GFP_KERNEL); idr_preload(GFP_KERNEL);
...@@ -416,7 +415,7 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private, ...@@ -416,7 +415,7 @@ static int drm_syncobj_fd_to_handle(struct drm_file *file_private,
} else } else
drm_syncobj_put(syncobj); drm_syncobj_put(syncobj);
fput(file); fdput(f);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册