From: Ville Syrjälä Date: Tue, 24 Sep 2013 18:26:21 +0000 (+0300) Subject: drm/i915: Don't underflow bestppm X-Git-Tag: next-20131017~56^2~113 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c686122c638838ce7113aeb22e4f1c50446de6eb;p=karo-tx-linux.git drm/i915: Don't underflow bestppm We do 'bestppm - 10' in vlv_find_best_dpll() but never check whether that might underflow. Add such a check. Signed-off-by: Ville Syrjälä Reviewed-by: Mika Kuoppala Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index dc5077560c74..789e6ab8fb19 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -708,7 +708,7 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc, bestppm = 0; flag = 1; } - if (ppm < bestppm - 10) { + if (bestppm >= 10 && ppm < bestppm - 10) { bestppm = ppm; flag = 1; }