DragonFlyBSD Kernel Audit
DF-1612 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/amd/display/dc/dcn10/dcn10_hubp.c b/sys/dev/drm/amd/display/dc/dcn10/dcn10_hubp.c
--- a/sys/dev/drm/amd/display/dc/dcn10/dcn10_hubp.c
+++ b/sys/dev/drm/amd/display/dc/dcn10/dcn10_hubp.c
@@ -120,7 +120,8 @@
 	value |= 0x100;
 	value &= ~0x1000;
 
-	if ((pipe_dest->vstartup_start - 2*(pipe_dest->vready_offset+pipe_dest->vupdate_width
+	if (pipe_dest->htotal != 0 &&
+	    (pipe_dest->vstartup_start - 2*(pipe_dest->vready_offset+pipe_dest->vupdate_width
 		+ pipe_dest->vupdate_offset) / pipe_dest->htotal) <= pipe_dest->vblank_end) {
 		/* if (eco_fix_needed(otg_global_sync_timing)
 		 * set HBUBREQ_DEBUG_DB[12] = 1 */