aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-28 12:52:22 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 22:20:08 -0400
commit2903ff019b346ab8d36ebbf54853c3aaf6590608 (patch)
tree962d94054765bb37bc00e977c3036e65c5fd91fe /arch/ia64
parenta5b470ba06aa3f96999ede5feba178df6bdb134a (diff)
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/perfmon.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index ff5d4e4c373..e3bd7b8acea 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -4780,7 +4780,7 @@ recheck:
4780asmlinkage long 4780asmlinkage long
4781sys_perfmonctl (int fd, int cmd, void __user *arg, int count) 4781sys_perfmonctl (int fd, int cmd, void __user *arg, int count)
4782{ 4782{
4783 struct file *file = NULL; 4783 struct fd f = {NULL, 0};
4784 pfm_context_t *ctx = NULL; 4784 pfm_context_t *ctx = NULL;
4785 unsigned long flags = 0UL; 4785 unsigned long flags = 0UL;
4786 void *args_k = NULL; 4786 void *args_k = NULL;
@@ -4789,7 +4789,6 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count)
4789 int narg, completed_args = 0, call_made = 0, cmd_flags; 4789 int narg, completed_args = 0, call_made = 0, cmd_flags;
4790 int (*func)(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs); 4790 int (*func)(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
4791 int (*getsize)(void *arg, size_t *sz); 4791 int (*getsize)(void *arg, size_t *sz);
4792 int fput_needed;
4793#define PFM_MAX_ARGSIZE 4096 4792#define PFM_MAX_ARGSIZE 4096
4794 4793
4795 /* 4794 /*
@@ -4878,17 +4877,17 @@ restart_args:
4878 4877
4879 ret = -EBADF; 4878 ret = -EBADF;
4880 4879
4881 file = fget_light(fd, &fput_needed); 4880 f = fdget(fd);
4882 if (unlikely(file == NULL)) { 4881 if (unlikely(f.file == NULL)) {
4883 DPRINT(("invalid fd %d\n", fd)); 4882 DPRINT(("invalid fd %d\n", fd));
4884 goto error_args; 4883 goto error_args;
4885 } 4884 }
4886 if (unlikely(PFM_IS_FILE(file) == 0)) { 4885 if (unlikely(PFM_IS_FILE(f.file) == 0)) {
4887 DPRINT(("fd %d not related to perfmon\n", fd)); 4886 DPRINT(("fd %d not related to perfmon\n", fd));
4888 goto error_args; 4887 goto error_args;
4889 } 4888 }
4890 4889
4891 ctx = file->private_data; 4890 ctx = f.file->private_data;
4892 if (unlikely(ctx == NULL)) { 4891 if (unlikely(ctx == NULL)) {
4893 DPRINT(("no context for fd %d\n", fd)); 4892 DPRINT(("no context for fd %d\n", fd));
4894 goto error_args; 4893 goto error_args;
@@ -4918,8 +4917,8 @@ abort_locked:
4918 if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT; 4917 if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT;
4919 4918
4920error_args: 4919error_args:
4921 if (file) 4920 if (f.file)
4922 fput_light(file, fput_needed); 4921 fdput(f);
4923 4922
4924 kfree(args_k); 4923 kfree(args_k);
4925 4924