diff options
| author | Jared Kangas <jkangas@redhat.com> | 2025-11-11 13:54:12 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-12-01 11:41:48 +0100 |
| commit | 6d9f0036d21e86d6500b7c3d264216854c7d12e6 (patch) | |
| tree | 7faf8c72e4b89119c3d6cab8e6502de068996a1b /drivers/pinctrl | |
| parent | 3b90bd8aaeb21b513ecc4ed03299e80ece44a333 (diff) | |
| download | linux-6d9f0036d21e86d6500b7c3d264216854c7d12e6.tar.gz linux-6d9f0036d21e86d6500b7c3d264216854c7d12e6.tar.bz2 linux-6d9f0036d21e86d6500b7c3d264216854c7d12e6.zip | |
pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()
[ Upstream commit 6010d4d8b55b5d3ae1efb5502c54312e15c14f21 ]
s32_pmx_gpio_request_enable() does not initialize the newly-allocated
gpio_pin_config::list before adding it to s32_pinctrl::gpio_configs.
This could result in a linked list corruption.
Initialize the new list_head with INIT_LIST_HEAD() to fix this.
Fixes: fd84aaa8173d ("pinctrl: add NXP S32 SoC family support")
Signed-off-by: Jared Kangas <jkangas@redhat.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/pinctrl')
| -rw-r--r-- | drivers/pinctrl/nxp/pinctrl-s32cc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 9e97968e25fc..9c435e44abb4 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -392,6 +392,7 @@ static int s32_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, gpio_pin->pin_id = offset; gpio_pin->config = config; + INIT_LIST_HEAD(&gpio_pin->list); spin_lock_irqsave(&ipctl->gpio_configs_lock, flags); list_add(&gpio_pin->list, &ipctl->gpio_configs); |
