]> Git Repo - linux.git/commitdiff
perf: Fix perf_event_init_context()
authorPeter Zijlstra <[email protected]>
Mon, 5 May 2014 17:12:20 +0000 (19:12 +0200)
committerIngo Molnar <[email protected]>
Wed, 7 May 2014 09:33:15 +0000 (11:33 +0200)
perf_pin_task_context() can return NULL but perf_event_init_context()
assumes it will not, correct this.

Reported-by: Vince Weaver <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/events/core.c

index ea899e2b5593e9633194ad68a42fb1f5f51728be..71232844f235f45068b1f6f30c5842693cff9e54 100644 (file)
@@ -7729,6 +7729,8 @@ int perf_event_init_context(struct task_struct *child, int ctxn)
         * swapped under us.
         */
        parent_ctx = perf_pin_task_context(parent, ctxn);
+       if (!parent_ctx)
+               return 0;
 
        /*
         * No need to check if parent_ctx != NULL here; since we saw
This page took 0.058993 seconds and 4 git commands to generate.