Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c25c74b7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull kprobe fix from Steven Rostedt:
 "This fixes a memory leak in the kprobe code"

* tag 'trace-v4.18-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing/kprobe: Release kprobe print_fmt properly
parents 86125df7 0fc8c358
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1480,8 +1480,10 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
	}

	ret = __register_trace_kprobe(tk);
	if (ret < 0)
	if (ret < 0) {
		kfree(tk->tp.call.print_fmt);
		goto error;
	}

	return &tk->tp.call;
error:
@@ -1501,6 +1503,8 @@ void destroy_local_trace_kprobe(struct trace_event_call *event_call)
	}

	__unregister_trace_kprobe(tk);

	kfree(tk->tp.call.print_fmt);
	free_trace_kprobe(tk);
}
#endif /* CONFIG_PERF_EVENTS */