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

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

 



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/

_______________________________________________
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