commit | f69f93586545a99b1fb9e802807023bae37f64d0 | [log] [tgz] |
---|---|---|
author | Peter Bigot <peter.bigot@nordicsemi.no> | Wed Sep 30 13:49:54 2020 -0500 |
committer | Carles CufĂ <carles.cufi@nordicsemi.no> | Fri Oct 09 11:48:00 2020 +0200 |
tree | 4edcd166e6c32ca3718978749951ecd5a4e91afc | |
parent | 8f9410a038ae3a81ae66f8978f8caa7ee79c646f [diff] |
kernel: delayed_work: fix race condition in k_delayed_work_cancel The implementation checks the work queue pointer before taking a lock and entering code that, depending on build options, may fault if that pointer is null. Move the check under the lock to ensure condition is preserved. Then the check in work_cancel is no longer necessary since condition is verified under lock at all call sites. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>