Re: [PATCH 11/24] Add rational_best_approximation()

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

 



On Wed, Jun 02, 2021 at 11:25:29AM -0700, Trent Piepho wrote:
> On Wed, Jun 2, 2021 at 3:05 AM Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> wrote:
> >
> > Import rational_best_approximation() from Linux. This is used by an
> > upcoming update of the clk_fractional_divider code.
> 
> > +               if ((n2 > max_numerator) || (d2 > max_denominator)) {
> > +                       unsigned long t = min((max_numerator - n0) / n1,
> > +                                             (max_denominator - d0) / d1);
> > +
> 
> There is a divide by zero bug in this version if the input is greater
> than the largest value allowed or less than the smallest non-zero
> value allowed.  I sent a patch to lkml for this a week ago,
> https://lore.kernel.org/patchwork/patch/1436255/

I applies that on top of the series.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux