drivers: spi_context: fix null pointer dereferencing
commit 54907c70 ("drivers: spi: spi_context: improve support of multiple cs gpios") added function to initialize all CS GPIOs defined in devicetree. This function, spi_context_cs_configure_all, is intended to be called during SPI driver initialization (POST_KERNEL init level). It is also obvious that a SPI driver was not used at that time, and no bus configuration (struct spi_config) is assigned to SPI bus (spi_context.config). The spi_context_cs_configure_all function has a homeopathic ASSERT to validate CS levels, which causes a null pointer dereferencing by ctx->config->operation if asserts are enabled. Signed-off-by:Johann Fischer <johann.fischer@nordicsemi.no>
Loading
Please sign in to comment