offchannel: always call destroy right away on cancel

The main cancel code path was not calling destroy immediately which
was not consistent with other code paths/APIs.
This commit is contained in:
James Prestwood 2021-12-15 09:41:46 -08:00 committed by Denis Kenzior
parent 1a27cd1548
commit 4a8a43965f
1 changed files with 10 additions and 12 deletions

View File

@ -208,20 +208,10 @@ void offchannel_cancel(uint64_t wdev_id, uint32_t id)
goto work_done; goto work_done;
} }
/* /* Lets the ROC callback know it needs to cancel the request */
* Call destroy now to maintain consistency with any other
* path leading to radio_work_done(). But set needs_cancel so
* the ROC command can be canceled
*/
if (info->destroy)
info->destroy(info->error, info->user_data);
info->destroy = NULL;
info->started = NULL;
info->user_data = NULL;
info->needs_cancel = true; info->needs_cancel = true;
return; goto destroy;
} }
/* /*
@ -239,6 +229,14 @@ void offchannel_cancel(uint64_t wdev_id, uint32_t id)
*/ */
offchannel_cancel_roc(info); offchannel_cancel_roc(info);
destroy:
if (info->destroy)
info->destroy(info->error, info->user_data);
info->destroy = NULL;
info->started = NULL;
info->user_data = NULL;
return; return;
work_done: work_done: