提交 866ecfdd 编写于 作者: A Al Viro

switch osf_getdirentries() to fget_light()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 132ea247
...@@ -144,12 +144,12 @@ SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd, ...@@ -144,12 +144,12 @@ SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd,
struct osf_dirent __user *, dirent, unsigned int, count, struct osf_dirent __user *, dirent, unsigned int, count,
long __user *, basep) long __user *, basep)
{ {
int error; int error, fput_needed;
struct file *file; struct file *file;
struct osf_dirent_callback buf; struct osf_dirent_callback buf;
error = -EBADF; error = -EBADF;
file = fget(fd); file = fget_light(fd, &fput_needed);
if (!file) if (!file)
goto out; goto out;
...@@ -164,7 +164,7 @@ SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd, ...@@ -164,7 +164,7 @@ SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd,
if (count != buf.count) if (count != buf.count)
error = count - buf.count; error = count - buf.count;
fput(file); fput_light(file, fput_needed);
out: out:
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册