Commit 3af548f
perf/x86/uncore: Fix potential NULL pointer in uncore_get_alias_name
The current code assumes that the discovery table provides valid
box_ids for the normal units. It's not the case anymore since some units
in the discovery table are broken on some SPR variants.
Factor out uncore_get_box_id(). Check the existence of the type->box_ids
before using it. If it's not available, use pmu_idx.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Petlan <mpetlan@redhat.com>
Link: https://lore.kernel.org/r/20230112200105.733466-3-kan.liang@linux.intel.com1 parent dbf061b commit 3af548f
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
860 | 866 | | |
861 | 867 | | |
862 | 868 | | |
| |||
865 | 871 | | |
866 | 872 | | |
867 | 873 | | |
868 | | - | |
| 874 | + | |
869 | 875 | | |
870 | 876 | | |
871 | 877 | | |
| |||
892 | 898 | | |
893 | 899 | | |
894 | 900 | | |
895 | | - | |
| 901 | + | |
896 | 902 | | |
897 | 903 | | |
898 | 904 | | |
| |||
0 commit comments