diff options
Diffstat (limited to 'arch/ia64/kernel/perfmon.c')
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index ff5d4e4c3733..e3bd7b8aceab 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -4780,7 +4780,7 @@ recheck: | |||
4780 | asmlinkage long | 4780 | asmlinkage long |
4781 | sys_perfmonctl (int fd, int cmd, void __user *arg, int count) | 4781 | sys_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 | ||
4920 | error_args: | 4919 | error_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 | ||