]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/kernel/perfmon.c
[IA64] correct file descriptor reference counting in perfmon
[linux-2.6-omap-h63xx.git] / 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));