⬢ DragonFlyBSD Kernel Audit
DF-4128 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/radeon/rv6xx_dpm.c
+++ b/sys/dev/drm/radeon/rv6xx_dpm.c
@@ -246,8 +246,10 @@ static void rv6xx_generate_steps(struct radeon_device *rdev,
 	struct rv6xx_sclk_stepping target;
 	bool increasing_vco;
 	u32 step_index = start_index;
 
-	rv6xx_convert_clock_to_stepping(rdev, low, &cur);
-	rv6xx_convert_clock_to_stepping(rdev, high, &target);
+	if (rv6xx_convert_clock_to_stepping(rdev, low, &cur) ||
+	    rv6xx_convert_clock_to_stepping(rdev, high, &target))
+		return;
@@ -297,7 +299,9 @@ static void rv6xx_generate_single_step(struct radeon_device *rdev,
 				       u32 clock, u32 index)
 {
 	struct rv6xx_sclk_stepping step;
 
-	rv6xx_convert_clock_to_stepping(rdev, clock, &step);
+	if (rv6xx_convert_clock_to_stepping(rdev, clock, &step))
+		return;
+
 	rv6xx_output_stepping(rdev, index, &step);
 }
# NOTE: authored against the read-only sys/ tree after verification; never applied there.