linux/tools/perf
Markus Elfring c160118a90 perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp()
Addresses of two data structure members were determined before
corresponding null pointer checks in the implementation of the function
“sort__sym_from_cmp”.

Thus avoid the risk for undefined behaviour by removing extra
initialisations for the local variables “from_l” and “from_r” (also
because they were already reassigned with the same value behind this
pointer check).

This issue was detected by using the Coccinelle software.

Fixes: 1b9e97a2a9 ("perf tools: Fix report -F symbol_from for data without branch info")
Signed-off-by: <elfring@users.sourceforge.net>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/cocci/54a21fea-64e3-de67-82ef-d61b90ffad05@web.de/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-04-13 19:01:51 -03:00
..
arch perf arm-spe: Use zfree() to reduce chances of use after free 2023-04-12 10:15:27 -03:00
bench perf bench inject-buildid: Use zfree() to reduce chances of use after free 2023-04-12 10:14:01 -03:00
dlfilters perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
Documentation perf lock contention: Update default map size to 16384 2023-04-06 21:52:27 -03:00
examples/bpf perf trace: Remove unused bpf map 'syscalls' 2022-11-23 10:30:00 -03:00
include/perf perf bpf: Remove now unused BPF headers 2022-11-04 11:41:48 -03:00
jvmti
pmu-events perf vendor events intel: Fix uncore topics for tigerlake 2023-04-13 18:56:18 -03:00
python perf python: Convert tracepoint.py example to python3 2022-04-01 16:19:35 -03:00
scripts perf scripts python intel-pt-events: Delete unused 'event_attr variable 2023-04-12 12:19:42 -03:00
tests perf map: Add map__refcnt() accessor to use in the maps test 2023-04-12 12:49:16 -03:00
trace perf beauty: Update copy of linux/socket.h with the kernel sources 2023-01-18 10:12:23 -03:00
ui perf util: Move perf_guest/host declarations 2023-04-10 19:22:05 -03:00
util perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp() 2023-04-13 19:01:51 -03:00
.gitignore perf jevents: Run metric_test.py at compile-time 2023-02-03 17:11:39 -03:00
Build perf script: Fix Python support when no libtraceevent 2023-03-15 10:27:07 -03:00
builtin-annotate.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-bench.c perf bench: Add pmu-scan benchmark 2023-04-04 13:23:58 -03:00
builtin-buildid-cache.c perf record: Disable debuginfod by default 2022-01-15 17:41:25 -03:00
builtin-buildid-list.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-c2c.c perf c2c: Use zfree() to reduce chances of use after free 2023-04-12 09:55:10 -03:00
builtin-config.c
builtin-daemon.c perf daemon: Use zfree() to reduce chances of use after free 2023-04-12 09:52:29 -03:00
builtin-data.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-diff.c perf util: Move perf_guest/host declarations 2023-04-10 19:22:05 -03:00
builtin-evlist.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-ftrace.c perf ftrace: Make system wide the default target for latency subcommand 2023-04-04 09:39:55 -03:00
builtin-help.c perf usage: Move usage strings 2023-04-10 19:20:53 -03:00
builtin-inject.c perf inject: Use zfree() to reduce chances of use after free 2023-04-12 09:50:08 -03:00
builtin-kallsyms.c perf map: Add helper for ->map_ip() and ->unmap_ip() 2023-04-06 22:10:17 -03:00
builtin-kmem.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-kvm.c perf util: Move perf_guest/host declarations 2023-04-10 19:22:05 -03:00
builtin-kwork.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-list.c perf list: Use zfree() to reduce chances of use after free 2023-04-12 09:55:44 -03:00
builtin-lock.c perf map: Add helper for ->map_ip() and ->unmap_ip() 2023-04-06 22:10:17 -03:00
builtin-mem.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-probe.c tools: Rename __fallthrough to fallthrough 2023-04-06 21:41:00 -03:00
builtin-record.c perf bpf filter: Show warning for missing sample flags 2023-03-15 11:08:36 -03:00
builtin-report.c perf map: Add accessors for ->pgoff and ->reloc 2023-04-06 22:12:40 -03:00
builtin-sched.c perf sched: Fix sched latency analysis incorrection when using 'sched:sched_wakeup' 2023-04-12 19:30:39 -03:00
builtin-script.c perf map: Add helper for ->map_ip() and ->unmap_ip() 2023-04-06 22:10:17 -03:00
builtin-stat.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-timechart.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
builtin-top.c perf top: Expand the range of multithreaded phase 2023-04-12 10:36:14 -03:00
builtin-trace.c perf trace: Use zfree() to reduce chances of use after free 2023-04-12 09:54:32 -03:00
builtin-version.c perf version: Use regular verbose flag 2023-04-10 19:21:17 -03:00
builtin.h perf usage: Move usage strings 2023-04-10 19:20:53 -03:00
check-headers.sh tools headers: Remove s390 ptrace.h in check-headers.sh 2023-04-12 10:32:54 -03:00
command-list.txt perf help: Use HAVE_LIBTRACEEVENT to filter out unsupported commands 2023-01-02 11:51:53 -03:00
CREDITS
design.txt perf design.txt: Synchronize the definition of enum perf_hw_id with code 2021-11-13 18:11:50 -03:00
Makefile perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
Makefile.config perf build: Warn for BPF skeletons if endian mismatches 2023-04-10 19:23:26 -03:00
Makefile.perf perf build: Add warning for when vmlinux.h generation fails 2023-04-04 09:39:54 -03:00
MANIFEST tools lib traceevent: Remove libtraceevent 2022-12-14 11:16:12 -03:00
perf-archive.sh
perf-completion.sh perf tools: Fix auto-complete on aarch64 2023-02-08 10:38:10 -03:00
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf util: Move input_name to util 2023-04-10 19:21:31 -03:00
perf.h perf util: Move perf_guest/host declarations 2023-04-10 19:22:05 -03:00