Commit 70615c4
committed
schedule: zephyr_ll: fix NULL pointer dereference and race conditions during task free
When a task is freed by zephyr_ll_task_free(), zephyr_ll_run() can still hold
a reference to the task's pdata structure across the LL lock boundary.
Re-fetching task->priv_data under zephyr_ll_lock() prevents evaluating
pdata->freeing on a stale/freed pointer. Additionally, add NULL checks for
pdata in zephyr_ll_task_done() and task/pdata in zephyr_ll_task_free().
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>1 parent cf89a85 commit 70615c4
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
300 | 301 | | |
301 | | - | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| |||
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | | - | |
| 461 | + | |
461 | 462 | | |
462 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
463 | 471 | | |
464 | 472 | | |
465 | 473 | | |
| |||
0 commit comments