Skip to content

pinctrl: s32cc: fix uninitialized memory issues

Jared Kangas linux-arm-kernel linux-gpio lkml 1 version In review

Get series with b4
b4 am [email protected] change-id 20251106-pinctrl-s32cc-alloc-init-cb04ebcc72f3

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2pinctrl: s32cc: fix uninitialized memory in s32_pinctrl_descdrivers/pinctrl/nxp/pinctrl-s32cc.c+1 -11 reply
2/2pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()drivers/pinctrl/nxp/pinctrl-s32cc.c+1 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchJan Petrous (OSS)
1/2T-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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: -- -- -- -- -- -- -- --

---
Jared Kangas (2):
pinctrl: s32cc: fix uninitialized memory in s32_pinctrl_desc
pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()

 drivers/pinctrl/nxp/pinctrl-s32cc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

---
base-commit: e9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c
change-id: 20251106-pinctrl-s32cc-alloc-init-cb04ebcc72f3

Best regards,

Signature · 1 line
Jared Kangas <[email protected]>