diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-28 12:52:22 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 22:20:08 -0400 |
commit | 2903ff019b346ab8d36ebbf54853c3aaf6590608 (patch) | |
tree | 962d94054765bb37bc00e977c3036e65c5fd91fe /fs/ioctl.c | |
parent | a5b470ba06aa3f96999ede5feba178df6bdb134a (diff) |
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ioctl.c')
-rw-r--r-- | fs/ioctl.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/fs/ioctl.c b/fs/ioctl.c index 29167bebe874..3bdad6d1f268 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -603,21 +603,14 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
603 | 603 | ||
604 | SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) | 604 | SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) |
605 | { | 605 | { |
606 | struct file *filp; | 606 | int error; |
607 | int error = -EBADF; | 607 | struct fd f = fdget(fd); |
608 | int fput_needed; | 608 | |
609 | 609 | if (!f.file) | |
610 | filp = fget_light(fd, &fput_needed); | 610 | return -EBADF; |
611 | if (!filp) | 611 | error = security_file_ioctl(f.file, cmd, arg); |
612 | goto out; | 612 | if (!error) |
613 | 613 | error = do_vfs_ioctl(f.file, fd, cmd, arg); | |
614 | error = security_file_ioctl(filp, cmd, arg); | 614 | fdput(f); |
615 | if (error) | ||
616 | goto out_fput; | ||
617 | |||
618 | error = do_vfs_ioctl(filp, fd, cmd, arg); | ||
619 | out_fput: | ||
620 | fput_light(filp, fput_needed); | ||
621 | out: | ||
622 | return error; | 615 | return error; |
623 | } | 616 | } |