mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 10:23:33 +08:00
Fix race condition in px4io serial driver (#20005)
* px4io: prevent memory corruption on corrput io data * px4io_serial: Prevent race between handling wait timeout case and interrupt posting semaphore
This commit is contained in:
@@ -1216,7 +1216,7 @@ int PX4IO::io_get_status()
|
||||
|
||||
uint16_t raw_inputs = io_reg_get(PX4IO_PAGE_RAW_RC_INPUT, PX4IO_P_RAW_RC_COUNT);
|
||||
|
||||
for (unsigned i = 0; i < raw_inputs; i++) {
|
||||
for (unsigned i = 0; (i < raw_inputs) && (i < _max_rc_input); i++) {
|
||||
status.raw_inputs[i] = io_reg_get(PX4IO_PAGE_RAW_RC_INPUT, PX4IO_P_RAW_RC_BASE + i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user