drm/amd/display: Check denominator pbn_div before used
authorjsg <jsg@openbsd.org>
Thu, 12 Sep 2024 23:36:35 +0000 (23:36 +0000)
committerjsg <jsg@openbsd.org>
Thu, 12 Sep 2024 23:36:35 +0000 (23:36 +0000)
From Alex Hung
dfafee0a7b51c7c9612edd2d991401294964d02f in linux-6.6.y/6.6.51
116a678f3a9abc24f5c9d2525b7393d18d9eb58e in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 4773734..9688dc5 100644 (file)
@@ -6941,7 +6941,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,
                        }
                }
 
-               if (j == dc_state->stream_count)
+               if (j == dc_state->stream_count || pbn_div == 0)
                        continue;
 
                slot_num = DIV_ROUND_UP(pbn, pbn_div);