Masami Hiramatsu
8043d5ee91
perf probe: Fix memory leakage when the probe point is not found
...
[ Upstream commit 12d572e785b15bc764e956caaa8a4c846fd15694 ]
Fix the memory leakage in debuginfo__find_trace_events() when the probe
point is not found in the debuginfo. If there is no probe point found in
the debuginfo, debuginfo__find_probes() will NOT return -ENOENT, but 0.
Thus the caller of debuginfo__find_probes() must check the tf.ntevs and
release the allocated memory for the array of struct probe_trace_event.
The current code releases the memory only if the debuginfo__find_probes()
hits an error but not checks tf.ntevs. In the result, the memory allocated
on *tevs are not released if tf.ntevs == 0.
This fixes the memory leakage by checking tf.ntevs == 0 in addition to
ret < 0.
Fixes: ff741783506c ("perf probe: Introduce debuginfo to encapsulate dwarf information")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: stable@vger.kernel.org
Link: http://lore.kernel.org/lkml/159438668346.62703.10887420400718492503.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-26 10:40:48 +02:00
..
2019-08-28 18:14:57 -03:00
2019-09-20 09:19:20 -03:00
2019-06-25 18:31:12 -03:00
2020-08-21 13:05:29 +02:00
2019-09-20 09:19:20 -03:00
2019-11-05 08:39:26 -03:00
2019-10-15 12:00:01 -03:00
2019-09-30 17:30:06 -03:00
2019-03-11 11:56:02 -03:00
2019-09-20 09:19:21 -03:00
2019-09-25 09:51:48 -03:00
2019-09-25 09:51:44 -03:00
2019-01-25 15:12:09 +01:00
2019-01-25 15:12:09 +01:00
2019-02-19 16:11:56 -03:00
2019-02-19 16:11:56 -03:00
2019-09-20 09:19:22 -03:00
2019-09-20 09:19:22 -03:00
2019-09-25 09:51:48 -03:00
2019-07-29 18:34:42 -03:00
2019-08-31 19:10:19 -03:00
2019-09-20 09:19:20 -03:00
2019-09-20 09:19:20 -03:00
2019-09-25 16:26:34 -03:00
2019-09-25 09:51:49 -03:00
2019-07-29 18:34:42 -03:00
2019-08-29 17:38:32 -03:00
2019-08-26 11:58:29 -03:00
2019-07-09 10:13:27 -03:00
2019-06-05 17:36:37 +02:00
2019-09-20 09:19:22 -03:00
2019-09-20 09:19:21 -03:00
2019-08-14 10:48:39 -03:00
2019-08-14 10:59:59 -03:00
2019-08-31 22:24:10 -03:00
2019-07-29 18:34:42 -03:00
2019-09-20 09:19:20 -03:00
2019-08-31 22:24:10 -03:00
2019-08-31 22:24:10 -03:00
2019-01-25 15:12:08 +01:00
2019-07-09 10:13:26 -03:00
2019-01-25 15:12:09 +01:00
2019-05-15 16:36:49 -03:00
2019-08-31 22:24:10 -03:00
2019-10-15 12:05:18 -03:00
2019-09-25 09:51:49 -03:00
2019-07-29 18:34:42 -03:00
2019-08-22 17:16:56 -03:00
2019-02-06 10:00:39 -03:00
2019-08-29 17:38:32 -03:00
2019-08-29 08:36:12 -03:00
2019-08-22 17:16:57 -03:00
2019-08-31 19:10:40 -03:00
2019-12-31 16:44:51 +01:00
2019-08-31 22:24:10 -03:00
2019-09-20 15:58:11 -03:00
2019-09-20 09:19:20 -03:00
2019-03-19 11:56:20 -03:00
2019-08-31 22:24:10 -03:00
2019-07-29 18:34:42 -03:00
2019-09-20 09:19:20 -03:00
2019-09-20 09:19:20 -03:00
2019-09-20 09:19:20 -03:00
2019-09-20 09:19:20 -03:00
2020-06-22 09:31:27 +02:00
2020-06-22 09:31:27 +02:00
2019-08-31 22:24:10 -03:00
2019-08-31 22:24:10 -03:00
2018-12-28 16:33:02 -03:00
2018-12-28 16:33:02 -03:00
2019-12-31 16:45:41 +01:00
2019-12-31 16:45:41 +01:00
2019-09-20 09:19:20 -03:00
2020-08-05 09:59:52 +02:00
2019-09-20 09:19:21 -03:00
2019-09-20 10:28:21 -03:00
2019-09-20 09:19:22 -03:00
2019-08-31 22:24:10 -03:00
2019-10-15 11:51:33 -03:00
2019-09-25 16:26:40 -03:00
2019-09-25 16:26:40 -03:00
2019-09-25 16:26:34 -03:00
2019-09-25 16:26:34 -03:00
2020-07-16 08:16:38 +02:00
2019-09-25 16:26:40 -03:00
2019-08-15 12:26:13 -03:00
2019-08-15 12:25:55 -03:00
2019-08-31 19:10:19 -03:00
2019-01-08 13:28:13 -03:00
2019-08-29 17:38:32 -03:00
2019-08-29 17:38:32 -03:00
2019-09-25 16:26:41 -03:00
2019-08-26 11:58:29 -03:00
2019-07-09 10:13:26 -03:00
2020-01-12 12:21:25 +01:00
2019-09-20 10:28:21 -03:00
2019-07-09 10:13:26 -03:00
2019-11-05 08:49:14 -03:00
2020-01-23 08:22:39 +01:00
2019-09-25 09:51:47 -03:00
2019-06-05 17:36:37 +02:00
2020-07-16 08:16:39 +02:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:37:04 +02:00
2019-01-25 15:12:10 +01:00
2019-09-30 17:29:49 -03:00
2019-06-19 17:09:51 +02:00
2019-09-20 10:28:26 -03:00
2019-09-30 17:29:35 -03:00
2019-08-29 17:38:32 -03:00
2019-09-20 09:19:20 -03:00
2020-01-26 10:01:02 +01:00
2019-09-20 09:19:22 -03:00
2019-08-16 12:25:57 -03:00
2019-02-06 10:00:38 -03:00
2020-04-02 15:11:02 +02:00
2019-07-29 18:34:42 -03:00
2019-08-31 19:10:40 -03:00
2019-08-31 19:10:40 -03:00
2019-08-31 22:27:48 -03:00
2019-08-31 22:27:48 -03:00
2019-09-20 09:19:22 -03:00
2020-01-12 12:21:25 +01:00
2019-08-31 22:27:52 -03:00
2019-09-25 09:51:49 -03:00
2019-09-25 09:51:46 -03:00
2019-09-20 10:28:21 -03:00
2019-09-20 10:28:21 -03:00
2019-08-31 19:10:19 -03:00
2018-12-17 15:02:17 -03:00
2019-08-31 19:10:19 -03:00
2019-12-31 16:45:01 +01:00
2019-08-14 10:59:59 -03:00
2019-08-14 10:59:59 -03:00
2019-09-25 16:26:41 -03:00
2019-07-09 10:13:22 -03:00
2019-05-15 16:36:49 -03:00
2019-08-31 22:24:10 -03:00
2019-08-31 22:24:10 -03:00
2019-09-25 16:26:34 -03:00
2019-05-16 14:17:12 -03:00
2020-01-04 19:18:27 +01:00
2019-09-20 09:19:20 -03:00
2019-05-28 18:37:44 -03:00
2019-09-20 09:19:21 -03:00
2019-08-31 22:27:51 -03:00
2019-06-25 21:02:47 -03:00
2020-06-22 09:31:27 +02:00
2019-05-25 23:04:42 -04:00
2020-04-01 11:01:59 +02:00
2019-05-25 23:04:42 -04:00
2020-08-26 10:40:48 +02:00
2019-06-25 21:02:47 -03:00
2019-08-31 19:10:19 -03:00
2019-09-25 16:26:34 -03:00
2019-09-30 17:29:57 -03:00
2019-01-25 15:12:10 +01:00
2019-06-05 17:37:04 +02:00
2019-01-25 15:12:10 +01:00
2019-09-25 09:51:48 -03:00
2019-08-26 11:58:22 -03:00
2019-07-09 14:59:11 -03:00
2019-07-09 14:59:11 -03:00
2019-09-20 09:19:20 -03:00
2019-01-21 17:00:48 -03:00
2018-08-08 15:26:48 -03:00
2019-09-20 09:19:21 -03:00
2018-08-03 10:34:18 -03:00
2019-09-20 09:19:20 -03:00
2019-07-29 18:34:42 -03:00
2019-07-29 18:34:42 -03:00
2019-12-31 16:45:40 +01:00
2019-09-20 09:19:22 -03:00
2019-07-09 10:13:26 -03:00
2019-08-14 10:48:39 -03:00
2019-06-10 16:20:11 -03:00
2019-09-25 09:51:48 -03:00
2019-08-31 22:24:10 -03:00
2019-09-25 09:51:48 -03:00
2019-02-06 10:00:38 -03:00
2020-06-03 08:21:39 +02:00
2019-01-25 15:12:09 +01:00
2020-06-24 17:50:45 +02:00
2020-02-19 19:53:08 +01:00
2020-07-22 09:33:05 +02:00
2019-09-20 10:28:26 -03:00
2019-08-31 19:10:19 -03:00
2019-07-09 10:13:26 -03:00
2019-07-01 22:50:40 -03:00
2019-07-01 22:50:40 -03:00
2019-07-09 10:13:26 -03:00
2019-01-25 15:12:10 +01:00
2019-09-20 09:19:21 -03:00
2019-08-29 17:38:31 -03:00
2019-07-02 13:20:51 -03:00
2019-08-31 22:24:05 -03:00
2019-09-25 09:51:49 -03:00
2019-09-20 09:19:20 -03:00
2020-06-22 09:31:27 +02:00
2019-08-31 22:27:48 -03:00
2019-08-31 22:24:05 -03:00
2019-09-25 09:51:48 -03:00
2019-09-20 09:19:22 -03:00
2019-07-29 18:34:42 -03:00
2019-07-29 18:34:42 -03:00
2019-09-20 09:19:20 -03:00
2019-08-29 08:36:12 -03:00
2019-08-29 08:36:12 -03:00
2019-08-31 19:10:19 -03:00
2019-06-17 20:48:14 +02:00
2019-08-31 22:24:10 -03:00
2019-08-26 19:39:11 -03:00
2020-01-23 08:23:01 +01:00
2020-01-23 08:23:01 +01:00
2019-08-26 19:39:11 -03:00
2019-09-25 09:51:48 -03:00
2019-08-31 22:24:10 -03:00
2019-09-25 09:51:48 -03:00
2019-11-05 08:39:27 -03:00
2019-09-20 09:19:20 -03:00
2019-08-29 17:38:32 -03:00
2019-09-20 09:19:20 -03:00
2019-11-05 08:39:27 -03:00
2019-08-29 17:38:32 -03:00
2019-09-20 09:19:22 -03:00
2019-09-20 09:19:20 -03:00
2019-09-20 09:19:20 -03:00
2019-08-31 22:24:10 -03:00
2019-08-16 12:25:57 -03:00
2019-09-20 09:19:20 -03:00
2019-10-15 11:54:11 -03:00
2019-09-25 09:51:49 -03:00
2019-08-31 19:10:19 -03:00
2019-09-20 09:19:20 -03:00
2019-07-09 10:13:26 -03:00
2019-09-20 09:19:20 -03:00
2019-07-23 09:04:03 -03:00