Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: Avoid overflow when sorting pp_feature list

pp_features sorting uses int8_t sort_feature[] to store driver
feature enum indices. On newer ASICs the enum index can exceed 127,
causing signed overflow and silently dropping entries from the output.
Switch the array to int16_t so all enum indices are preserved.

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Asad Kamal and committed by
Alex Deucher
8e8f6bda b2e997e6

+1 -1
+1 -1
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
··· 880 880 size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu, 881 881 char *buf) 882 882 { 883 - int8_t sort_feature[MAX(SMU_FEATURE_COUNT, SMU_FEATURE_MAX)]; 883 + int16_t sort_feature[MAX(SMU_FEATURE_COUNT, SMU_FEATURE_MAX)]; 884 884 struct smu_feature_bits feature_mask; 885 885 uint32_t features[2]; 886 886 int i, feature_index;