Skip to content

Commit 9713070

Browse files
Zhen Leiacmel
authored andcommitted
perf diff: Fix error return value in __cmd_diff()
An appropriate return value should be set on the failed path. Fixes: 2a09a84 ("perf diff: Support hot streams comparison") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20201124103652.438-1-thunder.leizhen@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 3b13eaf commit 9713070

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tools/perf/builtin-diff.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,10 @@ static int __cmd_diff(void)
12221222
if (compute == COMPUTE_STREAM) {
12231223
d->evlist_streams = evlist__create_streams(
12241224
d->session->evlist, 5);
1225-
if (!d->evlist_streams)
1225+
if (!d->evlist_streams) {
1226+
ret = -ENOMEM;
12261227
goto out_delete;
1228+
}
12271229
}
12281230
}
12291231

0 commit comments

Comments
 (0)