From: Jared Kangas <jkangas@redhat.com>
To: Dong Aisheng <aisheng.dong@nxp.com>,
Fabio Estevam <festevam@gmail.com>,
Shawn Guo <shawnguo@kernel.org>, Jacky Bai <ping.bai@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
NXP S32 Linux Team <s32@nxp.com>,
Chester Lin <chester62515@gmail.com>,
Matthias Brugger <mbrugger@suse.com>,
Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Jared Kangas <jkangas@redhat.com>
Subject: [PATCH 0/2] pinctrl: s32cc: fix uninitialized memory issues
Date: Tue, 11 Nov 2025 13:54:10 -0800 [thread overview]
Message-ID: <20251111-pinctrl-s32cc-alloc-init-v1-0-071b3485b776@redhat.com> (raw)
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@redhat.com>
---
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,
--
Jared Kangas <jkangas@redhat.com>
next reply other threads:[~2025-11-11 21:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 21:54 Jared Kangas [this message]
2025-11-11 21:54 ` [PATCH 1/2] pinctrl: s32cc: fix uninitialized memory in s32_pinctrl_desc Jared Kangas
2025-11-12 7:58 ` [EXT] " Jan Petrous (OSS)
2025-11-11 21:54 ` [PATCH 2/2] pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc() Jared Kangas
2025-11-18 22:56 ` [PATCH 0/2] pinctrl: s32cc: fix uninitialized memory issues Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251111-pinctrl-s32cc-alloc-init-v1-0-071b3485b776@redhat.com \
--to=jkangas@redhat.com \
--cc=aisheng.dong@nxp.com \
--cc=brgl@bgdev.pl \
--cc=chester62515@gmail.com \
--cc=festevam@gmail.com \
--cc=ghennadi.procopciuc@oss.nxp.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbrugger@suse.com \
--cc=ping.bai@nxp.com \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).