Skip to content

Commit 6010d4d

Browse files
rh-jkangasLinus Walleij
authored andcommitted
pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc()
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: fd84aaa ("pinctrl: add NXP S32 SoC family support") Signed-off-by: Jared Kangas <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 97ea34d commit 6010d4d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/pinctrl/nxp/pinctrl-s32cc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static int s32_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
392392

393393
gpio_pin->pin_id = offset;
394394
gpio_pin->config = config;
395+
INIT_LIST_HEAD(&gpio_pin->list);
395396

396397
spin_lock_irqsave(&ipctl->gpio_configs_lock, flags);
397398
list_add(&gpio_pin->list, &ipctl->gpio_configs);

0 commit comments

Comments
 (0)