Skip to content

Fix NULL pointer dereference in STM32 SPI construct#10926

Merged
dhalbert merged 1 commit intoadafruit:10.1.xfrom
ChrisNourse:fix-stm32-spi-null-deref-10.1.x
Apr 7, 2026
Merged

Fix NULL pointer dereference in STM32 SPI construct#10926
dhalbert merged 1 commit intoadafruit:10.1.xfrom
ChrisNourse:fix-stm32-spi-null-deref-10.1.x

Conversation

@ChrisNourse
Copy link
Copy Markdown

Move mark_deinit() before check_pins() so that self->sck is not NULLed after check_pins sets it. The previous ordering caused a NULL dereference of self->sck->altfn_index, crashing all STM32 boards that use SPI (including STM32F405 boards whose CIRCUITPY filesystem lives on external SPI flash).

Fixes #10866

Move mark_deinit() before check_pins() so that self->sck is not
NULLed after check_pins sets it. The previous ordering caused a
NULL dereference of self->sck->altfn_index, crashing all STM32
boards that use SPI (including STM32F405 boards whose CIRCUITPY
filesystem lives on external SPI flash).

Fixes adafruit#10866

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dhalbert dhalbert merged commit 974cc2c into adafruit:10.1.x Apr 7, 2026
40 checks passed
@ChrisNourse ChrisNourse deleted the fix-stm32-spi-null-deref-10.1.x branch April 8, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants