From 729af004c0754a75ebb49c1000530c5f1b7e6efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 5 Feb 2020 08:35:32 +0100 Subject: [PATCH] fix stm32_spibus_initialize: ensure leave_critical_section is called in case the requested SPI bus is invalid or not configured. --- arch/arm/src/stm32/stm32_spi.c | 1 - arch/arm/src/stm32f0l0g0/stm32_spi.c | 1 - arch/arm/src/stm32f7/stm32_spi.c | 1 - arch/arm/src/stm32h7/stm32_spi.c | 1 - 4 files changed, 4 deletions(-) diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 8a636f4d2f..c2cb1d81db 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -2120,7 +2120,6 @@ FAR struct spi_dev_s *stm32_spibus_initialize(int bus) #endif { spierr("ERROR: Unsupported SPI bus: %d\n", bus); - return NULL; } leave_critical_section(flags); diff --git a/arch/arm/src/stm32f0l0g0/stm32_spi.c b/arch/arm/src/stm32f0l0g0/stm32_spi.c index fb782f19ab..2e728e6ee2 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_spi.c +++ b/arch/arm/src/stm32f0l0g0/stm32_spi.c @@ -1778,7 +1778,6 @@ FAR struct spi_dev_s *stm32_spibus_initialize(int bus) #endif { spierr("ERROR: Unsupported SPI bus: %d\n", bus); - return NULL; } leave_critical_section(flags); diff --git a/arch/arm/src/stm32f7/stm32_spi.c b/arch/arm/src/stm32f7/stm32_spi.c index 8fbbaa23f9..bc8bb0875a 100644 --- a/arch/arm/src/stm32f7/stm32_spi.c +++ b/arch/arm/src/stm32f7/stm32_spi.c @@ -2178,7 +2178,6 @@ FAR struct spi_dev_s *stm32_spibus_initialize(int bus) #endif { spierr("ERROR: Unsupported SPI bus: %d\n", bus); - return NULL; } leave_critical_section(flags); diff --git a/arch/arm/src/stm32h7/stm32_spi.c b/arch/arm/src/stm32h7/stm32_spi.c index c1b9026b09..b84ed1c72d 100644 --- a/arch/arm/src/stm32h7/stm32_spi.c +++ b/arch/arm/src/stm32h7/stm32_spi.c @@ -2279,7 +2279,6 @@ FAR struct spi_dev_s *stm32_spibus_initialize(int bus) #endif { spierr("ERROR: Unsupported SPI bus: %d\n", bus); - return NULL; } leave_critical_section(flags);