diff mbox

ftrace/perf_event leak

Message ID 1283334095.2059.849.camel@laptop (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Zijlstra Sept. 1, 2010, 9:41 a.m. UTC
None
diff mbox

Patch

diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 000e6e8..31cc4cb 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -91,6 +91,8 @@  int perf_trace_init(struct perf_event *p_event)
 		    tp_event->class && tp_event->class->reg &&
 		    try_module_get(tp_event->mod)) {
 			ret = perf_trace_event_init(tp_event, p_event);
+			if (ret)
+				module_put(tp_event->mod);
 			break;
 		}
 	}