perf/core: Don't leak event in the syscall error path
[firefly-linux-kernel-4.4.55.git] / kernel / events / core.c
index c22f4579a2e75821a5cb0709e5e6e36fe6a4f6f5..b296032a2c4e6ae020473a3e93470e96f746fc5d 100644 (file)
@@ -8457,6 +8457,7 @@ SYSCALL_DEFINE5(perf_event_open,
                                        f_flags);
        if (IS_ERR(event_file)) {
                err = PTR_ERR(event_file);
+               event_file = NULL;
                goto err_context;
        }