Re: [PATCH] pinctrl: nomadik: validate DT pin config property read and range
From: Linus Walleij
Date: Thu Dec 03 2026 - 09:12:53 EST
Hi Elkin,
On Wed, Nov 25, 2026 at 11:27 PM Elkin Cruz <elkin@xxxxxxxxxx> wrote:
> In nmk_pinctrl_dt_get_config(), of_property_read_u32() is only checked
> for (ret != -EINVAL), passing an uninitialized val to
> nmk_dt_pin_config() on other error returns. In addition, val is signed
> and nmk_dt_pin_config() returns 0 even when val is out of bounds for
> nmk_cfg_params[index].choice.
>
> Check (!ret) after of_property_read_u32(), make val unsigned (u32), and
> return -EINVAL when val >= nmk_cfg_params[index].size.
>
> Fixes: e32af8894588 ("pinctrl/nomadik: add device tree support")
> Cc: stable@xxxxxxxxxxxxxxx
Nah it's not that urgent.
> Signed-off-by: Elkin Cruz <elkin@xxxxxxxxxx>
Patch applied as nonurgent fix.
Yours,
Linus Walleij