zephyr/drivers/pinctrl
Gerard Marull-Paretas 442fae1b38 drivers: pinctrl: fix lookup when there are no states
Right now it is possible that some devices define 0 pinctrl states in
devicetree, because pinctrl-N entries may still be optional for backward
compatibility. If the programmer makes a mistake and forgets them,
application could experience runtime crashes because
pinctrl_lookup_states assumes you have at least one state, so it does
not perform any bounds checking. Change the while condition so that it
is skipped if states count is zero.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-11 13:15:02 +01:00
..
CMakeLists.txt drivers: pinctrl: add NXP S32 SIUL2 driver 2022-10-14 09:51:14 +02:00
common.c drivers: pinctrl: fix lookup when there are no states 2022-11-11 13:15:02 +01:00
Kconfig drivers: pinctrl: add NXP S32 SIUL2 driver 2022-10-14 09:51:14 +02:00
Kconfig.b91 drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.cc13xx_cc26xx drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.esp32 drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.gd32 drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.imx nxp_imx: rt: add XBARA Inter-Peripheral Crossbar Switch Kconfig option 2022-07-01 16:23:11 +00:00
Kconfig.it8xxx2 drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.kinetis drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.lpc_iocon drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.npcx drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.nrf drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.rcar drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.rpi_pico drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.rv32m1 drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.s32 drivers: pinctrl: add NXP S32 SIUL2 driver 2022-10-14 09:51:14 +02:00
Kconfig.sam drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.sam0 drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.sifive drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.smartbond drivers: pinctrl: Add driver for smartbond 2022-08-31 20:32:03 +02:00
Kconfig.stm32 drivers: pinctrl: stm32: Kconfig: add missing dependency 2022-08-08 14:17:45 +02:00
Kconfig.xec drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.xlnx drivers: pinctrl: Update drivers to use devicetree Kconfig symbol 2022-07-25 05:46:42 -05:00
Kconfig.xmc4xxx drivers: pinctrl: Add pinctrl driver for xmc4xxx 2022-09-09 16:28:41 -04:00
pfc_rcar.c include: add missing arch/cpu.h include 2022-10-11 18:05:17 +02:00
pinctrl_b91.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_cc13xx_cc26xx.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_esp32.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_gd32_af.c drivers: gpio,pinctrl: gd32: use clock control API 2022-09-06 09:57:25 +02:00
pinctrl_gd32_afio.c drivers: gpio,pinctrl: gd32: use clock control API 2022-09-06 09:57:25 +02:00
pinctrl_imx.c drivers: pinctrl: remove soc.h from pinctrl_imx 2022-09-05 10:17:13 +02:00
pinctrl_ite_it8xxx2.c drivers: pinctrl: it8xxx2: add missing chip_chipregs.h 2022-10-11 18:05:17 +02:00
pinctrl_kinetis.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_lpc_iocon.c drivers: pinctrl: update lpc pinctrl driver for lpc11u6x 2022-05-10 17:27:44 -05:00
pinctrl_mchp_xec.c soc: arm: microchip: add common mec_gpio.h 2022-10-08 18:32:33 +02:00
pinctrl_npcx.c pinctrl: npcx: add pinctrl support for psl pads 2022-07-07 14:12:52 +00:00
pinctrl_nrf.c drivers: pinctrl_nrf: Configure QSPI CSN pin as output set high 2022-09-19 15:30:02 +02:00
pinctrl_rpi_pico.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_rv32m1.c include: add missing soc.h include 2022-10-11 18:05:17 +02:00
pinctrl_s32.c drivers: pinctrl: add NXP S32 SIUL2 driver 2022-10-14 09:51:14 +02:00
pinctrl_sam.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_sam0.c drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
pinctrl_sifive.c include: add missing arch/cpu.h include 2022-10-11 18:05:17 +02:00
pinctrl_smartbond.c drivers: pinctrl: Add driver for smartbond 2022-08-31 20:32:03 +02:00
pinctrl_stm32.c devices: constify statically initialized device pointers 2022-08-19 11:51:26 +02:00
pinctrl_xlnx_zynq.c devices: constify statically initialized device pointers 2022-08-19 11:51:26 +02:00
pinctrl_xmc4xxx.c drivers: pinctrl: Add pinctrl driver for xmc4xxx 2022-09-09 16:28:41 -04:00