[PATCH 0/2] pinctrl: s32cc: fix uninitialized memory issues

Linus Walleij linus.walleij at linaro.org
Tue Nov 18 14:56:58 PST 2025


On Tue, Nov 11, 2025 at 10:55 PM Jared Kangas <jkangas at redhat.com> wrote:

> This is a small series that fixes some uninitialized memory issues in
> pinctrl-s32cc. As an example of how these can affect the kernel, when
> probing i2c-imx, a memory allocation may fail because of the
> uninitialized memory giving a junk allocation size, which prevents chips
> on one of the I2C buses from being detected:
>
>         # i2cdetect -l
>         i2c-1   i2c             401ec000.i2c                            I2C adapter
>         i2c-2   i2c             402dc000.i2c                            I2C adapter
>         i2c-0   i2c             401e4000.i2c                            I2C adapter
>         # i2cdetect -y 0
>              0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>         00:          -- -- -- -- -- -- -- -- -- -- -- -- --
>         10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         70: -- -- -- -- -- -- -- --
>
> Compared to when no failure occurs:
>
>         # i2cdetect -l
>         i2c-1   i2c             401ec000.i2c                            I2C adapter
>         i2c-2   i2c             402dc000.i2c                            I2C adapter
>         i2c-0   i2c             401e4000.i2c                            I2C adapter
>         # i2cdetect -y 0
>              0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
>         00:          -- -- -- -- -- -- -- -- -- -- -- -- --
>         10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         20: -- -- UU -- -- -- -- -- -- -- -- -- -- -- -- --
>         30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
>         50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>         70: -- -- -- -- -- -- -- --
>
> Signed-off-by: Jared Kangas <jkangas at redhat.com>
> ---
> Jared Kangas (2):
>       pinctrl: s32cc: fix uninitialized memory in s32_pinctrl_desc
>       pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()

Patches applied for fixes!

Nice attention to detail here.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list