mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()
[ Upstream commit6010d4d8b5] 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:fd84aaa817("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7bbdd6c30e
commit
87cd3b57ad
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user