]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()
authorJared Kangas <jkangas@redhat.com>
Tue, 11 Nov 2025 21:54:12 +0000 (13:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Dec 2025 10:45:58 +0000 (11:45 +0100)
commit87cd3b57ad635fcd9f2acb8c0a444ecc4d956ddf
tree1ba2d796df792598b7831d062fe678433829e7c5
parent7bbdd6c30e8fd92f7165b7730b038cfe42102004
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>
drivers/pinctrl/nxp/pinctrl-s32cc.c