switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
23
fs/ioctl.c
23
fs/ioctl.c
@@ -603,21 +603,14 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
|
||||
|
||||
SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
|
||||
{
|
||||
struct file *filp;
|
||||
int error = -EBADF;
|
||||
int fput_needed;
|
||||
int error;
|
||||
struct fd f = fdget(fd);
|
||||
|
||||
filp = fget_light(fd, &fput_needed);
|
||||
if (!filp)
|
||||
goto out;
|
||||
|
||||
error = security_file_ioctl(filp, cmd, arg);
|
||||
if (error)
|
||||
goto out_fput;
|
||||
|
||||
error = do_vfs_ioctl(filp, fd, cmd, arg);
|
||||
out_fput:
|
||||
fput_light(filp, fput_needed);
|
||||
out:
|
||||
if (!f.file)
|
||||
return -EBADF;
|
||||
error = security_file_ioctl(f.file, cmd, arg);
|
||||
if (!error)
|
||||
error = do_vfs_ioctl(f.file, fd, cmd, arg);
|
||||
fdput(f);
|
||||
return error;
|
||||
}
|
||||
|
Reference in New Issue
Block a user