aboutsummaryrefslogtreecommitdiffstats
path: root/trace-output.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-output.c')
-rw-r--r--trace-output.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/trace-output.c b/trace-output.c
index 9df5394..46afe48 100644
--- a/trace-output.c
+++ b/trace-output.c
@@ -1032,7 +1032,7 @@ int tracecmd_attach_cpu_data_fd(int fd, int cpus, char * const *cpu_data_files)
1032 1032
1033 handle = malloc(sizeof(*handle)); 1033 handle = malloc(sizeof(*handle));
1034 if (!handle) 1034 if (!handle)
1035 return -1; 1035 goto out_free;
1036 memset(handle, 0, sizeof(*handle)); 1036 memset(handle, 0, sizeof(*handle));
1037 1037
1038 handle->fd = fd; 1038 handle->fd = fd;
@@ -1044,10 +1044,9 @@ int tracecmd_attach_cpu_data_fd(int fd, int cpus, char * const *cpu_data_files)
1044 pevent_ref(pevent); 1044 pevent_ref(pevent);
1045 handle->page_size = tracecmd_page_size(ihandle); 1045 handle->page_size = tracecmd_page_size(ihandle);
1046 1046
1047 if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) < 0) 1047 if (tracecmd_append_cpu_data(handle, cpus, cpu_data_files) >= 0)
1048 goto out_free; 1048 ret = 0;
1049 1049
1050 ret = 0;
1051 tracecmd_output_close(handle); 1050 tracecmd_output_close(handle);
1052 out_free: 1051 out_free:
1053 tracecmd_close(ihandle); 1052 tracecmd_close(ihandle);