BLE: fixed callback not checking if the event queue exists and executing sometimes after the queue was deleted

This commit is contained in:
Th3maz1ng 2025-02-09 19:07:05 +01:00
parent bd2a19e2a0
commit f04b461acb

View File

@ -248,8 +248,12 @@ os_callout_timer_cb(void *ptmr, void *parg)
struct ble_npl_callout *co;
co = (struct ble_npl_callout *)parg;
if(co->evq) {
ble_npl_eventq_put(co->evq, &co->ev);
if(co->evq)
{
/* In some cases, the event queue g_eventq_dflt is already
deleted when this callback is called raising an issue ! */
if(co->evq->q)
ble_npl_eventq_put(co->evq, &co->ev);
} else {
co->ev.fn(&co->ev);
}