]> git.baikalelectronics.ru Git - kernel.git/commit
perf llvm: Return -ENOMEM when asprintf() fails
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Jul 2021 17:20:58 +0000 (14:20 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Jul 2021 19:14:37 +0000 (16:14 -0300)
commit4c5a58c5a70384b94020fd7eaf8dde009a39f645
treedf5c5d040a865680e10df096314cdd28cb807047
parent59e121a727cb58a644650bdf84943edf1214168b
perf llvm: Return -ENOMEM when asprintf() fails

Zhihao sent a patch but it made llvm__compile_bpf() return what
asprintf() returns on error, which is just -1, but since this function
returns -errno, fix it by returning -ENOMEM for this case instead.

Fixes: 2b325e6c4b82d8 ("perf llvm: Allow passing options to llc ...")
Fixes: fc230d9bf8a778 ("perf llvm: Display eBPF compiling command ...")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reported-by: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: clang-built-linux@googlegroups.com
Link: http://lore.kernel.org/lkml/20210609115945.2193194-1-chengzhihao1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/llvm-utils.c