diff --git a/arch/arm/src/gd32f4/gd32f4xx_gpio.c b/arch/arm/src/gd32f4/gd32f4xx_gpio.c index 37017fd69b..57362f368a 100644 --- a/arch/arm/src/gd32f4/gd32f4xx_gpio.c +++ b/arch/arm/src/gd32f4/gd32f4xx_gpio.c @@ -306,6 +306,7 @@ int gd32_gpio_config(uint32_t cfgset) port = (cfgset & GPIO_CFG_PORT_MASK) >> GPIO_CFG_PORT_SHIFT; if (port >= GD32_NGPIO_PORTS) { + leave_critical_section(flags); return -EINVAL; } @@ -357,8 +358,8 @@ int gd32_gpio_config(uint32_t cfgset) break; default: - return -EINVAL; - break; + leave_critical_section(flags); + return -EINVAL; } regval = getreg32(GD32_GPIO_CTL(port_base)); diff --git a/arch/arm/src/stm32u5/stm32_serial.c b/arch/arm/src/stm32u5/stm32_serial.c index 54c014d2ae..20029d9342 100644 --- a/arch/arm/src/stm32u5/stm32_serial.c +++ b/arch/arm/src/stm32u5/stm32_serial.c @@ -2737,6 +2737,7 @@ static void stm32serial_txint(struct uart_dev_s *dev, bool enable) # ifdef CONFIG_STM32U5_SERIALBRK_BSDCOMPAT if (priv->ie & USART_CR1_IE_BREAK_INPROGRESS) { + leave_critical_section(flags); return; } # endif diff --git a/arch/arm/src/stm32wl5/stm32wl5_serial.c b/arch/arm/src/stm32wl5/stm32wl5_serial.c index e623467977..e23bad5c77 100644 --- a/arch/arm/src/stm32wl5/stm32wl5_serial.c +++ b/arch/arm/src/stm32wl5/stm32wl5_serial.c @@ -2492,6 +2492,7 @@ static void stm32wl5serial_txint(struct uart_dev_s *dev, bool enable) # ifdef CONFIG_STM32WL5_SERIALBRK_BSDCOMPAT if (priv->ie & USART_CR1_IE_BREAK_INPROGRESS) { + leave_critical_section(flags); return; } # endif diff --git a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_buttons.c b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_buttons.c index 1e53ed311b..a92a8b93b4 100644 --- a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_buttons.c +++ b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_buttons.c @@ -149,6 +149,7 @@ int board_button_irq(int id, xcpt_t irqhandler, void *arg) if (ret < 0) { + leave_critical_section(flags); return ret; } @@ -161,6 +162,7 @@ int board_button_irq(int id, xcpt_t irqhandler, void *arg) if (ret < 0) { + leave_critical_section(flags); return ret; } diff --git a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_gpio.c b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_gpio.c index 83cc58d867..6cc745cdf8 100644 --- a/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_gpio.c +++ b/boards/arm/gd32f4/gd32f450zk-eval/src/gd32f4xx_gpio.c @@ -256,6 +256,7 @@ static int gpint_attach(struct gpio_dev_s *dev, pin_interrupt_t callback) if (ret < 0) { + leave_critical_section(flags); return ret; } @@ -291,6 +292,7 @@ static int gpint_enable(struct gpio_dev_s *dev, bool enable) &gpio_irqnum); if (ret < 0) { + leave_critical_section(flags); return ret; } diff --git a/boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c b/boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c index 29903ffffe..5d421fbcd3 100644 --- a/boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c +++ b/boards/arm/s32k1xx/rddrone-bms772/src/s32k1xx_smbus_sbd.c @@ -219,6 +219,7 @@ static ssize_t smbus_sbd_read(struct file *filep, char *buffer, * nothing was read. */ + leave_critical_section(flags); return 0; } @@ -316,6 +317,7 @@ static ssize_t smbus_sbd_write(struct file *filep, const char *buffer, * nothing was written. */ + leave_critical_section(flags); return 0; } diff --git a/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_apds9960.c b/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_apds9960.c index 086d1d5382..17924b4f74 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_apds9960.c +++ b/boards/risc-v/esp32c3/esp32c3-devkit-rust-1/src/esp32c3_apds9960.c @@ -117,6 +117,7 @@ static int apds9960_irq_attach(struct apds9960_config_s *state, ret = irq_attach(irq, isr, arg); if (ret < 0) { + leave_critical_section(flags); syslog(LOG_ERR, "ERROR: apds9960_irq_attach() failed: %d\n", ret); return ret; } diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_djoystick.c b/boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_djoystick.c index 48503a80cb..1bd1de0619 100644 --- a/boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_djoystick.c +++ b/boards/xtensa/esp32s3/esp32s3-devkit/src/esp32s3_djoystick.c @@ -208,6 +208,7 @@ static void djoy_enable(const struct djoy_lowerhalf_s *lower, ret = irq_attach(irq, djoy_interrupt, arg); if (ret < 0) { + leave_critical_section(flags); syslog(LOG_ERR, "ERROR: irq_attach() failed: %d\n", ret); return; }