Skip to content
Commit 26a43ca8 authored by Fabrice DJIATSA's avatar Fabrice DJIATSA Committed by Dan Kalowsky
Browse files

drivers: serial: stm32: prevent race condition



The async_user_callback could be triggered from
both the DMA transfer complete interrupt and
a k_work queue timeout. Since the timeout runs
outside of an ISR context, it could be interrupted
by the DMA ISR. This might leads to a race condition
where both paths access and modify shared
DMA buffer state (offset and length) simultaneously,
causing data corruption or out-of-sequence processing.

Introduces proper synchronization to prevent concurrent
access to shared DMA buffer variables,
ensuring consistent and reliable data handling.

Signed-off-by: default avatarFabrice DJIATSA <fabrice.djiatsa-ext@st.com>
parent 21daac55
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment