You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASoC: SOF: sof-audio: harden recursive widget free walk
During widget FREE traversal, SOF walks DAPM sink paths recursively while
widgets and paths can be torn down. This can lead to stale pointer usage in
sof_free_widgets_in_path() when path entries disappear during recursion.
Harden the FREE path by:
- validating scheduler/pipeline pointers before recursive free
- using a safe DAPM path iterator for sink traversal
- carrying a stable widget-list snapshot through recursion
- skipping NULL sink edges during traversal
The safe traversal can leave path->walking set on surviving edges after FREE,
which may short-circuit later DAPM walks and break consecutive playback
open/stop cycles. Reset walking flags for widgets in the current DAPM list
after FREE walks (including error paths) to keep subsequent traversals clean.
This keeps teardown robust for module-remove race scenarios while preserving
normal consecutive playback behavior.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
0 commit comments