We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7af0814 commit f221188Copy full SHA for f221188
tools/perf/util/data.c
@@ -35,7 +35,7 @@ void perf_data__close_dir(struct perf_data *data)
35
int perf_data__create_dir(struct perf_data *data, int nr)
36
{
37
struct perf_data_file *files = NULL;
38
- int i, ret = -1;
+ int i, ret;
39
40
if (WARN_ON(!data->is_dir))
41
return -EINVAL;
@@ -51,7 +51,8 @@ int perf_data__create_dir(struct perf_data *data, int nr)
51
for (i = 0; i < nr; i++) {
52
struct perf_data_file *file = &files[i];
53
54
- if (asprintf(&file->path, "%s/data.%d", data->path, i) < 0)
+ ret = asprintf(&file->path, "%s/data.%d", data->path, i);
55
+ if (ret < 0)
56
goto out_err;
57
58
ret = open(file->path, O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR);
0 commit comments