Commit 7456a29b authored by Al Viro's avatar Al Viro

switch itanic perfmonctl(2) to fget_light()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 866ecfdd
...@@ -4791,6 +4791,7 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count) ...@@ -4791,6 +4791,7 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count)
int narg, completed_args = 0, call_made = 0, cmd_flags; int narg, completed_args = 0, call_made = 0, cmd_flags;
int (*func)(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs); int (*func)(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
int (*getsize)(void *arg, size_t *sz); int (*getsize)(void *arg, size_t *sz);
int fput_needed;
#define PFM_MAX_ARGSIZE 4096 #define PFM_MAX_ARGSIZE 4096
/* /*
...@@ -4879,7 +4880,7 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count) ...@@ -4879,7 +4880,7 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count)
ret = -EBADF; ret = -EBADF;
file = fget(fd); file = fget_light(fd, &fput_needed);
if (unlikely(file == NULL)) { if (unlikely(file == NULL)) {
DPRINT(("invalid fd %d\n", fd)); DPRINT(("invalid fd %d\n", fd));
goto error_args; goto error_args;
...@@ -4920,7 +4921,7 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count) ...@@ -4920,7 +4921,7 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count)
error_args: error_args:
if (file) if (file)
fput(file); fput_light(file, fput_needed);
kfree(args_k); kfree(args_k);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment