Commit 0af42d67 authored by Sanskriti Sharma's avatar Sanskriti Sharma Committed by Greg Kroah-Hartman

perf tools: Cleanup trace-event-info 'tdata' leak

[ Upstream commit faedbf3fd19f2511a39397f76359e4cc6ee93072 ]

Free tracing_data structure in tracing_data_get() error paths.

Fixes the following coverity complaint:

  Error: RESOURCE_LEAK (CWE-772):
  leaked_storage: Variable "tdata" going out of scope leaks the storage
Signed-off-by: default avatarSanskriti Sharma <>
Reviewed-by: default avatarJiri Olsa <>
Cc: Joe Lawrence <>
Link: default avatarArnaldo Carvalho de Melo <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 401bd18c
......@@ -507,12 +507,14 @@ struct tracing_data *tracing_data_get(struct list_head *pattrs,
if (!mkstemp(tdata->temp_file)) {
pr_debug("Can't make temp file");
return NULL;
temp_fd = open(tdata->temp_file, O_RDWR);
if (temp_fd < 0) {
pr_debug("Can't read '%s'", tdata->temp_file);
return NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment