[PATCH] pinctrl: single: Fix potential division by zero

Linus Walleij linus.walleij at linaro.org
Mon Nov 21 05:42:31 PST 2022


On Thu, Nov 17, 2022 at 1:32 PM Maxim Korotkov
<korotkov.maxim.s at gmail.com> wrote:

> There is a possibility of dividing by zero due to the pcs->bits_per_pin
> if pcs->fmask() also has a value of zero and called fls
> from asm-generic/bitops/builtin-fls.h or arch/x86/include/asm/bitops.h.
> The function pcs_probe() has the branch that assigned to fmask 0 before
> pcs_allocate_pin_table() was called
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules")
> Signed-off-by: Maxim Korotkov <korotkov.maxim.s at gmail.com>

Patch applied for fixes.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list