]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fix mis-applied upstream commit ac9721f3f54b27a16c7e1afb2481e7ee95a70318
authorJan Beulich <JBeulich@novell.com>
Tue, 6 Jul 2010 10:09:00 +0000 (11:09 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:29:20 +0000 (10:29 -0700)
For some reason one of the changes to sys_perf_event_open() got
mis-applied, thus breaking (at least) error handling paths (pointed
out by means of a compiler warning).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/perf_event.c

index a2446518c9cedea6cf09e971f45176246df48cbd..2357b19b2451eb5f4c8017dfee853bb2037ed636 100644 (file)
@@ -4870,6 +4870,15 @@ SYSCALL_DEFINE5(perf_event_open,
        if (event_fd < 0)
                return event_fd;
 
+       /*
+        * Get the target context (task or percpu):
+        */
+       ctx = find_get_context(pid, cpu);
+       if (IS_ERR(ctx)) {
+               err = PTR_ERR(ctx);
+               goto err_fd;
+       }
+
        if (group_fd != -1) {
                group_leader = perf_fget_light(group_fd, &fput_needed);
                if (IS_ERR(group_leader)) {
@@ -4883,15 +4892,6 @@ SYSCALL_DEFINE5(perf_event_open,
                        group_leader = NULL;
        }
 
-       /*
-        * Get the target context (task or percpu):
-        */
-       ctx = find_get_context(pid, cpu);
-       if (IS_ERR(ctx)) {
-               err = PTR_ERR(ctx);
-               goto err_fd;
-       }
-
        /*
         * Look up the group leader (we will attach this event to it):
         */