diff options
| author | Song Liu <[email protected]> | 2021-10-04 05:32:38 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2021-10-31 15:51:41 +0000 |
| commit | 29c77550eef31b0d72a45b49eeab03b8963264e8 (patch) | |
| tree | 9853fa319869458ac97e8b5ad05164729102179c /scripts/gcc-plugins/randomize_layout_plugin.c | |
| parent | perf build: Suppress 'rm dlfilter' build message (diff) | |
| download | kernel-29c77550eef31b0d72a45b49eeab03b8963264e8.tar.gz kernel-29c77550eef31b0d72a45b49eeab03b8963264e8.zip | |
perf script: Check session->header.env.arch before using it
When perf.data is not written cleanly, we would like to process existing
data as much as possible (please see f_header.data.size == 0 condition
in perf_session__read_header). However, perf.data with partial data may
crash perf. Specifically, we see crash in 'perf script' for NULL
session->header.env.arch.
Fix this by checking session->header.env.arch before using it to determine
native_arch. Also split the if condition so it is easier to read.
Committer notes:
If it is a pipe, we already assume is a native arch, so no need to check
session->header.env.arch.
Signed-off-by: Song Liu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
0 files changed, 0 insertions, 0 deletions
