OSDN Git Service

Merge 4.4.163 into android-4.4
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / kernel / events / core.c
index bfed031..0f9ada2 100644 (file)
@@ -7023,6 +7023,8 @@ void perf_tp_event(u64 addr, u64 count, void *record, int entry_size,
                        goto unlock;
 
                list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
+                       if (event->cpu != smp_processor_id())
+                               continue;
                        if (event->attr.type != PERF_TYPE_TRACEPOINT)
                                continue;
                        if (event->attr.config != entry->type)
@@ -7144,7 +7146,7 @@ static void perf_event_free_bpf_prog(struct perf_event *event)
        prog = event->tp_event->prog;
        if (prog && event->tp_event->bpf_prog_owner == event) {
                event->tp_event->prog = NULL;
-               bpf_prog_put_rcu(prog);
+               bpf_prog_put(prog);
        }
 }
 
@@ -8538,6 +8540,7 @@ SYSCALL_DEFINE5(perf_event_open,
                                        f_flags);
        if (IS_ERR(event_file)) {
                err = PTR_ERR(event_file);
+               event_file = NULL;
                goto err_context;
        }