Skip to content

Commit

Permalink
[IA64] correct file descriptor reference counting in perfmon
Browse files Browse the repository at this point in the history
Fix a bug in sys_perfmonctl() whereby it was not correctly
decrementing the file descriptor reference count.

Signed-off-by: stephane eranian <eranian@hpl.hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Stephane Eranian authored and Tony Luck committed Sep 8, 2006
1 parent e9f7bee commit b8444d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4936,13 +4936,15 @@ sys_perfmonctl (int fd, int cmd, void __user *arg, int count)
if (likely(ctx)) {
DPRINT(("context unlocked\n"));
UNPROTECT_CTX(ctx, flags);
fput(file);
}

/* copy argument back to user, if needed */
if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT;

error_args:
if (file)
fput(file);

kfree(args_k);

DPRINT(("cmd=%s ret=%ld\n", PFM_CMD_NAME(cmd), ret));
Expand Down

0 comments on commit b8444d0

Please sign in to comment.