]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[IA64] correct file descriptor reference counting in perfmon
authorStephane Eranian <eranian@hpl.hp.com>
Fri, 25 Aug 2006 21:00:19 +0000 (14:00 -0700)
committerTony Luck <tony.luck@intel.com>
Fri, 8 Sep 2006 17:59:14 +0000 (10:59 -0700)
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>
arch/ia64/kernel/perfmon.c

index c7ccd6ee1ddfe57d7668794098e716bc77192189..84a7e52f56f6618358cf734da9176adf71271dcf 100644 (file)
@@ -4936,13 +4936,15 @@ abort_locked:
        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));