mirror of
https://github.com/torvalds/linux.git
synced 2026-11-09 05:34:02 +01:00
drm/amd/display: Guard against empty DCN6 UTM QoS table
[Why] The UTM QoS model population indexed into a firmware-provided table without checking whether it reported any load levels or SOPs, leaving a malformed table treated as valid instead of absent. [How] Bail out early and clear the output model pointer when the load level count or SOP count is zero. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Wenjing Liu <wenjing.liu@amd.com> Signed-off-by: James Lin <pinglei.lin@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
3b381dc0ed
commit
762e89c63a
|
|
@ -625,6 +625,11 @@ static void dcn60_populate_utm_qos_model(
|
|||
const SocUtmTable_t *utm_table = &init_table->UtmTable;
|
||||
unsigned int ll, sop;
|
||||
|
||||
if (utm_table->Header.LoadLevelCount == 0 || utm_table->Header.SopCount == 0) {
|
||||
*qos_model = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
memset(dchub, 0, sizeof(*dchub));
|
||||
dchub->load_level_count = (uint8_t)utm_table->Header.LoadLevelCount;
|
||||
dchub->sop_count = (uint8_t)utm_table->Header.SopCount;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user