DragonFlyBSD Kernel Audit
DF-1708 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/dev/drm/radeon/radeon_clocks.c b/sys/dev/drm/radeon/radeon_clocks.c
--- a/sys/dev/drm/radeon/radeon_clocks.c
+++ b/sys/dev/drm/radeon/radeon_clocks.c
@@ -356,6 +356,12 @@
 		    RREG32_PLL(RADEON_M_SPLL_REF_FB_DIV) &
 		    RADEON_M_SPLL_REF_DIV_MASK;
 
+	if (spll->reference_freq == 0 || ref_div == 0) {
+		*post_div = 1;
+		*fb_div = 0;
+		return 0;
+	}
+
 	if (req_clock < 15000) {
 		*post_div = 8;
 		req_clock *= 8;