lib/os/work_q: sanity check work_q handler prior to calling it
Just as NULL pointers should not be dereferenced, they should not be called either. Fixes 26723 Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
This commit is contained in:
parent
6f53c0a809
commit
3835b0bd1c
|
@ -25,6 +25,7 @@ void z_work_q_main(void *work_q_ptr, void *p2, void *p3)
|
|||
}
|
||||
|
||||
handler = work->handler;
|
||||
__ASSERT(handler != NULL, "handler must be provided");
|
||||
|
||||
/* Reset pending state so it can be resubmitted by handler */
|
||||
if (atomic_test_and_clear_bit(work->flags,
|
||||
|
|
Loading…
Reference in a new issue