Re: [PATCH 38/49] drm/i915: check for div-by-zero in vlv_PLL_is_optimal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 19, 2015 at 01:31:44PM -0700, Jesse Barnes wrote:
> On 03/17/2015 02:40 AM, Imre Deak wrote:
> > Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 7feb047..5874512 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -786,6 +786,9 @@ static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq,
> >  			       unsigned int best_error_ppm,
> >  			       unsigned int *error_ppm)
> >  {
> > +	if (WARN_ON_ONCE(!target_freq))
> > +		return false;
> > +
> >  	*error_ppm = div_u64(1000000ULL *
> >  				abs(target_freq - calculated_clock->dot),
> >  			     target_freq);
> > 
> 
> Thank you.  This one bites a lot in debug.
> 
> Reviewed-by: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>

I went ahead and merged these 2 prep patches to dinq right away.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux